{"uid":"cap_TcCHPlr79THik2riaMzoY","slug":"orthogonal-baseten-chat-completions-b9d75ddd","name":"Orthogonal Baseten Chat Completions","description":"Send a conversation to a model and get a completion back. Works exactly like the OpenAI chat completions endpoint. Pass messages and a model slug, get a response with the assistant's reply. Supports streaming for real-time token delivery, tool calling for function execution, structured outputs via response_format, and controllable reasoning depth on supported models. | ERROR: Unable to calculate price.","url":"https://x402.orthogonal.com/baseten/v1/chat/completions","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"n":{"type":"number","description":"Number of completions to generate. Currently only supports 1."},"bad":{"type":"string","description":"Words or phrases the model should avoid generating. Passed as a string."},"echo":{"type":"boolean","description":"If true, prepends the last input message to the generated output."},"seed":{"type":"number","description":"Integer for deterministic sampling. Same seed with same parameters should return the same result. Not guaranteed across model versions."},"stop":{"type":"string","description":"Up to 4 sequences where the model will stop generating. Can be a string or array of strings."},"user":{"type":"string","description":"A unique string identifying the end user. Useful for abuse monitoring and rate limiting."},"min_p":{"type":"number","description":"Minimum probability threshold. Tokens below this probability relative to the most likely token are filtered out."},"model":{"type":"string","description":"Model slug to run inference against. Available models: deepseek-ai/DeepSeek-V3-0324 (164k context, reasoning), deepseek-ai/DeepSeek-V3.1 (164k context, reasoning), zai-org/GLM-4.6 (200k context, reasoning), zai-org/GLM-4.7 (200k context, reasoning), moonshotai/Kimi-K2-Instruct-0905 (128k context), moonshotai/Kimi-K2-Thinking (262k context, always-on reasoning), moonshotai/Kimi-K2.5 (262k context), openai/gpt-oss-120b (128k context). Reasoning models support the reasoning_effort parameter for controlling thinking depth."},"tools":{"type":"array","description":"Array of tool/function definitions the model can call. Each tool has {\"type\": \"function\", \"function\": {\"name\": \"...\", \"description\": \"...\", \"parameters\": {...}}}. The model may respond with tool_calls instead of content."},"top_k":{"type":"number","description":"Top-K sampling. Only the K most likely next tokens are considered. Lower values make output more focused."},"top_p":{"type":"number","description":"Nucleus sampling threshold between 0 and 1. Only tokens within this cumulative probability mass are considered. 0.1 means only the top 10%. Use as an alternative to temperature."},"stream":{"type":"boolean","description":"If true, returns server-sent events (SSE) with partial message deltas as tokens are generated, instead of waiting for the full response."},"best_of":{"type":"number","description":"Number of candidate completions to generate server-side, returning the best. Currently only supports 1."},"logprobs":{"type":"boolean","description":"If true, returns the log probabilities of each output token in the response."},"messages":{"type":"array","description":"Array of message objects, each with a 'role' (system, user, assistant, tool) and 'content' (string or array of content parts). This is the conversation history sent to the model."},"documents":{"type":"array","description":"Array of document objects for retrieval-augmented generation (RAG). Each document has content the model can reference when responding."},"top_p_min":{"type":"number","description":"Minimum dynamic nucleus sampling threshold. Sets a floor for top_p when using adaptive sampling."},"ignore_eos":{"type":"boolean","description":"If true, the model continues generating past the end-of-sequence token."},"logit_bias":{"type":"object","description":"Map of token IDs to bias values (-100 to 100). Increase or decrease the likelihood of specific tokens appearing in the output."},"max_tokens":{"type":"number","description":"Maximum number of tokens to generate in the response. Default is 4096."},"min_tokens":{"type":"number","description":"Minimum number of tokens to generate before any stop condition can trigger."},"temperature":{"type":"number","description":"Sampling temperature between 0 and 4. Lower values (e.g. 0.2) produce more focused, deterministic output. Higher values (e.g. 1.5) increase creativity. Default is 1."},"tool_choice":{"type":"string","description":"Controls tool calling behavior. 'auto' lets the model decide, 'none' disables tools, 'required' forces a tool call, or pass {\"type\": \"function\", \"function\": {\"name\": \"...\"}} to force a specific tool."},"top_logprobs":{"type":"number","description":"How many of the most likely tokens (0-20) to return log probabilities for at each position. Requires logprobs to be true."},"bad_token_ids":{"type":"array","description":"Array of token IDs that should never appear in the output."},"chat_template":{"type":"string","description":"Custom Jinja2 template for formatting the conversation. Overrides the model's default chat template."},"early_stopping":{"type":"boolean","description":"In beam search, stop as soon as the required number of complete candidates are found."},"length_penalty":{"type":"number","description":"Penalty applied during beam search. Values > 1.0 favor longer sequences, < 1.0 favor shorter ones."},"stop_token_ids":{"type":"array","description":"Array of token IDs that will cause generation to stop when produced."},"stream_options":{"type":"object","description":"Options for streaming. Use {\"include_usage\": true} to get a final chunk with token usage statistics."},"response_format":{"type":"object","description":"Constrain the output format. Use {\"type\": \"json_object\"} for JSON mode, or {\"type\": \"json_schema\", \"json_schema\": {\"name\": \"...\", \"schema\": {...}}} for structured outputs with a specific schema."},"presence_penalty":{"type":"number","description":"Penalize tokens based on whether they've appeared at all. Range -2.0 to 2.0. Positive values encourage the model to explore new topics. Default: 0."},"reasoning_effort":{"type":"string","description":"Controls thinking depth for reasoning models. Options: 'low', 'medium', 'high'. Default: 'medium'. Higher effort uses more tokens but produces more thorough reasoning. Supported on DeepSeek V3/V3.1, GLM 4.6/4.7, and Kimi K2 Thinking."},"frequency_penalty":{"type":"number","description":"Penalize tokens based on how often they've appeared so far. Range -2.0 to 2.0. Positive values reduce repetition. Default: 0."},"add_special_tokens":{"type":"boolean","description":"If true, adds special tokens (like BOS) to the input. Default: true."},"chat_template_args":{"type":"object","description":"Additional arguments passed to the chat template as template variables."},"repetition_penalty":{"type":"number","description":"Multiplicative penalty for repeated tokens. Values > 1.0 discourage repetition, < 1.0 encourage it."},"parallel_tool_calls":{"type":"boolean","description":"Whether the model can make multiple tool calls in parallel in a single response. Default: true."},"skip_special_tokens":{"type":"boolean","description":"If true, special tokens are removed from the output text. Default: true."},"disaggregated_params":{"type":"object","description":"Advanced parameters for distributed inference. Only relevant for disaggregated serving configurations."},"add_generation_prompt":{"type":"boolean","description":"If true, applies the model's generation prompt template. Usually needed for chat models."},"truncate_prompt_tokens":{"type":"number","description":"Truncate the prompt to this many tokens if it exceeds the limit, keeping the most recent tokens."},"include_stop_str_in_output":{"type":"boolean","description":"If true, includes the stop string in the generated output rather than trimming it."},"spaces_between_special_tokens":{"type":"boolean","description":"If true, adds spaces between special tokens in the detokenized output."}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.005","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.005/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_oWIl-X5LLzae0iz0X4-8N","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.005","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Send a chat conversation to a hosted LLM (DeepSeek, GLM, Kimi, or GPT-OSS) and receive a text completion, with support for streaming, tool calling, structured outputs, and reasoning depth control.","exampleAgentPrompt":"Using the DeepSeek-V3-0324 model, send this conversation to the Orthogonal Baseten chat completions endpoint and get a reply: system message 'You are a helpful assistant', user message 'Explain the Fermi paradox in two paragraphs' — stream the tokens back and use medium reasoning effort.","exampleUseCases":[{"title":"Agentic tool-calling pipeline","prompt":"I need you to call the Orthogonal Baseten completions API with the Kimi-K2-Instruct model, pass it my list of tool definitions for weather and calendar lookup, and send the user message 'What is on my calendar this Friday and will I need an umbrella?' — return whatever tool calls the model decides to make."},{"title":"Structured JSON extraction from text","prompt":"Send this support ticket text to the GLM-4.7 model via Orthogonal Baseten with a response_format set to JSON schema, so I get back a structured object with fields for issue_type, priority, and customer_name extracted from the message."},{"title":"Deep reasoning over a coding problem","prompt":"Use the Kimi-K2-Thinking model on Orthogonal Baseten — set reasoning_effort to high — and ask it to find and fix the bug in this Python function I'll paste: it's supposed to merge two sorted lists but returns duplicates."}],"resultDescription":"Returns an OpenAI-compatible chat completion object containing the assistant's message content, an optional array of tool_calls if the model chose to invoke functions, finish_reason, token usage counts, and an optional reasoning trace. When streaming is enabled, delivers server-sent events of delta chunks until a [DONE] signal.","failureModes":["Unsupported model slug returns a 400 or 422 validation error","Exceeding the model's context window (e.g. 128k or 262k tokens) causes a context-length error","Payment or x402 authorization failure results in a 402 response before inference runs","Streaming connection drop mid-response leaves a partial completion","Requesting n > 1 completions returns an error since only n=1 is supported","Malformed tool definition schema causes the model to ignore tools or return an error"],"whenToPreferThis":"Choose this endpoint when you need an OpenAI-compatible chat completions interface backed by frontier open-weight models like DeepSeek-V3, GLM-4, or Kimi-K2 — especially when you want reasoning depth control, very long context windows (up to 262k tokens), or access to models not available on OpenAI directly. Prefer it over OpenAI's own endpoint when cost efficiency or model diversity matters, and over raw Baseten when you want a pay-per-call x402 payment model without managing your own Baseten account.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-13T18:50:09.921Z","isFirstParty":false}