{"uid":"cap_XxrlSquWTOIv1EqXjm5Z-","slug":"surplus-intelligence-ai-inference-chat-completions-2bd93448","name":"Surplus Intelligence AI Inference Chat Completions","description":"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.","url":"https://www.surplusintelligence.ai/api/inference/v1/chat/completions","method":"POST","headers":{},"bodySchema":{"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"}}}}}}},"responseSchema":{"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"}]}},"example":{"request":{"model":"llama-3.3-70b","stream":false,"messages":[{"role":"user","content":"What is artificial intelligence?"}],"max_tokens":150},"response":{"id":"chatcmpl-Ry3NOcCgEyMU9NLOOwCT6Jw9","model":"venice-llama70b","usage":{"total_tokens":165,"prompt_tokens":15,"completion_tokens":150},"object":"chat.completion","choices":[{"index":0,"message":{"role":"assistant","content":"Artificial intelligence (AI) refers to the simulation of human intelligence in machines that are programmed to think like humans and mimic their actions. The term may also be applied to any machine that exhibits traits associated with a human mind such as learning and problem-solving.\n\nThe ideal characteristic of artificial intelligence is its ability to rationalize and take actions that have the best chance of achieving a specific goal, given the constraints and limitations imposed upon it. \n\nAI involves a broad range of disciplines, including computer science, mathematics, engineering, psychology, linguistics, philosophy, neuroscience, and cognitive science. \n\nAI can be classified into two broad categories:\n\n1. **Narrow or Weak AI:** This type of AI is designed and trained for a specific task. Virtual personal","provider_specific_fields":{"name":null,"refusal":null}},"finish_reason":"length","provider_specific_fields":{}}],"created":1781239143,"service_tier":"default","venice_parameters":{"enable_e2ee":true,"enable_x_search":false,"disable_thinking":false,"enable_web_search":"off","enable_web_scraping":false,"enable_web_citations":false,"web_search_citations":[],"strip_thinking_response":false,"include_venice_system_prompt":false,"include_search_results_in_stream":false,"return_search_results_as_documents":false},"usage_from_consumer":{"total_tokens":159,"prompt_tokens":9,"completion_tokens":150},"usage_from_provider":{"total_tokens":159,"prompt_tokens":9,"completion_tokens":150}}},"exampleRequest":{"model":"llama-3.3-70b","stream":false,"messages":[{"role":"user","content":"What is artificial intelligence?"}],"max_tokens":150},"tags":["x402"],"displayCostAmount":"0.003315","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"settled","requiresHandshake":false,"reviewCount":1,"rating":{"score":"0.00","successRate":"0.00","reviews":1,"stars":null,"state":"rated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.003315/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003315","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003315","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_9e66CycRmf3fw8IFof2vX","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.003315","costPer":"request","priority":0,"asset":null,"unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Routes chat completion requests to the cheapest available AI model provider via an open order book marketplace, returning OpenAI-compatible responses.","exampleAgentPrompt":"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.","exampleUseCases":null,"resultDescription":"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.","failureModes":["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"],"whenToPreferThis":"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.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":1,"lastUsedAt":"2026-06-20T01:38:51.624Z","lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-16T00:34:58.980Z","isFirstParty":false}