chat_completions
Send chat completion requests with smart routing. Choose a model or let the router pick, then get the response and routing metadata.
Instructions
Send a chat completion request to GammaInfra and receive the model response plus routing metadata. Smart routing picks the best-fit model when model='gammainfra/auto'; pin a specific model like 'openai/gpt-5-mini' for direct dispatch. Returns the OpenAI-shape response in a 'response' field and routing decisions (provider, endpoint, cost in USD, router version, fallback chain) in a 'routing_meta' field. Streaming is not supported via MCP; the request always uses stream=false.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | Yes | Model name. Use 'gammainfra/auto' to let the router pick, 'gammainfra/fast' for latency, 'gammainfra/cheap' for cost, or pin a specific provider/model like 'openai/gpt-5-mini' or 'anthropic/claude-opus-4-7'. | |
| tools | No | ||
| top_p | No | ||
| region | No | Constrain endpoint region: 'us', 'eu', 'apac', or specific AWS region like 'us-east-1'. Sent as X-GammaInfra-Region header. | |
| messages | Yes | Conversation messages in OpenAI shape. | |
| max_tokens | No | ||
| preference | No | Coarse routing preference. Sent as X-GammaInfra-Preference header. | |
| temperature | No | ||
| tool_choice | No | ||
| cost_quality | No | Continuous cost-vs-quality dial. 0.0 = pure quality, 1.0 = pure cost. Sent as X-GammaInfra-Cost-Quality header. | |
| max_latency_ms | No | Cap total wall-clock time (including fallback retries) in ms. Sent as X-GammaInfra-Max-Latency-Ms header. | |
| response_format | No | ||
| presence_penalty | No | ||
| frequency_penalty | No | ||
| max_completion_tokens | No |