{"openapi":"3.1.0","info":{"title":"Surf Inference","version":"1.0.0","description":"OpenAI-compatible LLM inference API with x402 or MPP payment. Supports streaming via SSE.","x-guidance":"POST /v1/chat/completions with { model, messages } for LLM inference. Available models: moonshotai/kimi-k2.5, minimax/minimax-m2.5, qwen/qwen-2.5-7b-instruct, anthropic/claude-sonnet-4.5, anthropic/claude-sonnet-4.6, anthropic/claude-opus-4.5, anthropic/claude-opus-4.6, minimax/minimax-m2.7, z-ai/glm-5, x-ai/grok-4.1-fast, x-ai/grok-4.20-beta, x-ai/grok-4.20-multi-agent-beta, x-ai/grok-4.1-fast:online, x-ai/grok-4.20-beta:online, x-ai/grok-4.20-multi-agent-beta:online. Supports SSE streaming with stream: true. Accepts x402 USDC payment (Solana or Base) or MPP sessions (Tempo)."},"servers":[{"url":"https://inference.surf"}],"components":{"schemas":{"ChatCompletionResponse":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string"},"created":{"type":"integer"},"model":{"type":"string"},"choices":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer"},"message":{"type":"object","properties":{"role":{"type":"string"},"content":{"type":"string","nullable":true},"tool_calls":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"function":{"type":"object","properties":{"name":{"type":"string"},"arguments":{"type":"string"}},"required":["name","arguments"]}},"required":["id","type","function"]}}},"required":["role"],"additionalProperties":{"nullable":true}},"finish_reason":{"type":"string"}},"required":["index","message","finish_reason"]}},"usage":{"type":"object","properties":{"prompt_tokens":{"type":"integer"},"completion_tokens":{"type":"integer"},"total_tokens":{"type":"integer"}},"required":["prompt_tokens","completion_tokens","total_tokens"],"additionalProperties":{"nullable":true}}},"required":["id","object","created","model","choices"],"additionalProperties":{"nullable":true}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"},"suggestion":{"type":"string"}},"required":["error"]},"ChatCompletionBody":{"type":"object","properties":{"model":{"type":"string","minLength":1,"description":"Model identifier","example":"moonshotai/kimi-k2.5"},"messages":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","example":"user"},"content":{"anyOf":[{"type":"string"},{"nullable":true},{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"}},"required":["type"],"additionalProperties":{"nullable":true}}}]}},"required":["role"],"additionalProperties":{"nullable":true}},"minItems":1,"description":"Chat messages"},"max_tokens":{"type":"integer","nullable":true,"description":"Max tokens to generate"},"max_completion_tokens":{"type":"integer","nullable":true,"description":"Max completion tokens (preferred over max_tokens)"},"temperature":{"type":"number","nullable":true,"description":"Sampling temperature (0-2)"},"top_p":{"type":"number","nullable":true,"description":"Nucleus sampling"},"stream":{"type":"boolean","description":"Enable SSE streaming"},"tools":{"type":"array","items":{"nullable":true},"description":"Tool definitions"}},"required":["model","messages"],"additionalProperties":{"nullable":true}}},"parameters":{}},"paths":{"/v1/chat/completions":{"post":{"tags":["Inference"],"summary":"Chat completion","description":"OpenAI-compatible chat completion endpoint with x402 or MPP payment. Supports streaming via SSE.  Flat-priced models: qwen/qwen-2.5-7b-instruct ($0.001).  Dynamic-priced models (scales with prompt size and max_tokens): moonshotai/kimi-k2.5, minimax/minimax-m2.7, z-ai/glm-5, x-ai/grok-4.1-fast, x-ai/grok-4.20-beta, x-ai/grok-4.20-multi-agent-beta, anthropic/claude-sonnet-4.5, anthropic/claude-sonnet-4.6, anthropic/claude-opus-4.5, anthropic/claude-opus-4.6.  Search-enabled variants (include live X/Twitter + web search via xAI native tools): x-ai/grok-4.1-fast:online, x-ai/grok-4.20-beta:online, x-ai/grok-4.20-multi-agent-beta:online. Default max_tokens: 4096 when omitted.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatCompletionBody"}}}},"responses":{"200":{"description":"Chat completion response (or SSE stream when stream=true)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatCompletionResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"Payment Required"},"502":{"description":"Upstream Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-payment-info":{"protocols":["x402","mpp"],"pricingMode":"quote"}}}}}