Overview
AI Sonar exposes multiple API formats so common coding tools, SDKs, and frameworks can integrate with minimal glue code. This page is intentionally narrower than a marketing matrix:- Supported means we document a concrete setup path and AI Sonar exposes the protocol shape that path expects.
- Strong native path means the repo also has direct adapter or request-format evidence for that protocol family.
- Best-effort means the integration can work, but the client does not treat this custom gateway workflow as a stable contract.
Unsupported fields are not handled uniformly. On compatibility routes, some fields are ignored or normalized. On
/v1/responses, unsupported fields can return explicit 400 or 503 errors when that route cannot guarantee the requested behavior.Supported API Formats
IDE & CLI Compatibility
Documented Tool Paths
Other OpenAI-compatible editors and agent tools often work with the same base URL pattern; check the tool’s own custom-provider support before using it in production.
Configuration Examples
- Cursor
- Claude Code
- OpenCode
- Aider
- OpenAI format:
{ type: "function", function: { name, parameters } } - Anthropic format:
{ name, input_schema }(no type field)
SDK Compatibility
Documented SDK & Framework Paths
Chat Completions Parameters
Core Parameters
Tool Calling
Tool Choice Options
Advanced Parameters
OpenAI Advanced Features
Provider-Specific Options
Anthropic Messages Parameters
Core Parameters
Tool Calling
Extended Thinking
Responses API Parameters
Core Parameters
Advanced Parameters
Tool Format
Supports both OpenAI and Anthropic tool formats:Gemini API Parameters
Core Parameters
Tools
Safety Settings
Additional Parameters
Streaming
Generation endpoints that exposestream: true, including Chat Completions and Responses, use Server-Sent Events (SSE):
Error Handling
AI Sonar returns OpenAI-compatible error responses:Best Practices
Use passthrough for unknown parameters
Use passthrough for unknown parameters
Unknown parameters are forwarded only when the selected public route and model support them.
Use stream_options.include_usage only for Chat Completions
Use stream_options.include_usage only for Chat Completions
For Chat Completions streaming, enable
stream_options.include_usage for accurate token counts. Responses has its own streaming contract and does not expose this Chat-only option.Use appropriate tool_choice format
Use appropriate tool_choice format
Match your SDK’s expected format. AI Sonar accepts both OpenAI and Anthropic formats.