# Surplus Intelligence AI Inference Chat Completions

> Surplus Intelligence AI Inference Chat Completions is a paid API for AI agents from www.surplusintelligence.ai, paid per call via x402, $0.003315/call, status unknown (last checked 2026-09-16).

Routes chat completion requests to the cheapest available AI model provider via an open order book marketplace, returning OpenAI-compatible responses.

## Facts

- Endpoint: POST https://www.surplusintelligence.ai/api/inference/v1/chat/completions
- Price: $0.003315/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-16
- Success rate: 0% of calls made through Zero
- Activations on Zero: 1
- Tags: x402
- Canonical page: https://www.zero.xyz/c/surplus-intelligence-ai-inference-chat-completions-2bd93448
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_XxrlSquWTOIv1EqXjm5Z-

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability surplus-intelligence-ai-inference-chat-completions-2bd93448 -d '<json body>'
```

Example prompt: Use Surplus Intelligence's open market to run a chat completion with llama-3.3-70b — send the system message 'You are a helpful assistant' and user message 'What is the capital of France?' with a max of 200 tokens.

## When to prefer this

Choose this endpoint when cost is the primary concern for LLM inference and you want market-driven price discovery across multiple providers. Ideal for high-volume workloads where 90% cost savings over direct API calls justify routing through a marketplace. Best when you need OpenAI-compatible chat completion format and can tolerate slight routing latency. Prefer over direct provider APIs when you want to arbitrage across GPT, Claude, and open-source model prices automatically.

## Known failure modes

- Invalid or unsupported model name returns an error
- Insufficient USDC balance or failed x402 payment results in 402 Payment Required
- Malformed messages array (missing role or content) returns 400 Bad Request
- Model temporarily unavailable due to no matching market orders
- Stream mode errors if SSE not properly handled by client
- max_tokens set too low causing truncated or empty completions

## How this service works

Buy the cheapest inference. Sell your credits. The open order book for AI models. Up to 90% off GPT-5.5, Claude Opus 4.8, and more.

## Output

Returns an OpenAI-compatible chat.completion JSON object containing the assistant's reply message, finish reason (e.g. 'stop'), token usage breakdown (prompt, completion, total tokens), a completion ID, and the model object type.

## Example request

```json
{
 "model": "llama-3.3-70b",
 "stream": false,
 "messages": [
  {
   "role": "user",
   "content": "What is artificial intelligence?"
  }
 ],
 "max_tokens": 150
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "required": [
      "model",
      "messages"
     ],
     "properties": {
      "model": {
       "type": "string",
       "description": "Surplus Intelligence model id. Call /v1/models for available models."
      },
      "stream": {
       "type": "boolean"
      },
      "messages": {
       "type": "array",
       "items": {
        "type": "object",
        "required": [
         "role",
         "content"
        ],
        "properties": {
         "role": {
          "enum": [
           "system",
           "developer",
           "user",
           "assistant",
           "tool"
          ],
          "type": "string"
         },
         "content": {}
        },
        "additionalProperties": true
       },
       "minItems": 1,
       "description": "OpenAI-compatible chat messages."
      },
      "max_tokens": {
       "type": "integer",
       "minimum": 1,
       "description": "Maximum output tokens."
      },
      "temperature": {
       "type": "number",
       "maximum": 2,
       "minimum": 0
      }
     },
     "additionalProperties": true
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST",
      "PUT",
      "PATCH"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "required": [
      "id",
      "object",
      "choices"
     ],
     "properties": {
      "id": {
       "type": "string"
      },
      "usage": {
       "type": "object"
      },
      "object": {
       "type": "string"
      },
      "choices": {
       "type": "array"
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "id": "chatcmpl_surplus_example",
  "usage": {
   "total_tokens": 18,
   "prompt_tokens": 12,
   "completion_tokens": 6
  },
  "object": "chat.completion",
  "choices": [
   {
    "index": 0,
    "message": {
     "role": "assistant",
     "content": "Hello from Surplus Intelligence."
    },
    "finish_reason": "stop"
   }
  ]
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/surplus-intelligence-ai-inference-chat-completions-2bd93448/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from www.surplusintelligence.ai](https://www.zero.xyz/host/www.surplusintelligence.ai/llms.txt)
