Skip to main content

Overview

AI Sonar is easiest to integrate by matching the SDK to the behavior you need:
  • official Anthropic SDKs for Claude-native /v1/messages behavior
  • official Gemini / Google AI tooling for Gemini-native request shapes
  • official OpenAI SDKs for OpenAI-compatible /v1 routes and Responses-style usage
Use the integration pages for support boundaries. In this docs set, “recommended” or “supported” means a documented setup path exists; it does not automatically cover every framework helper or provider-specific feature.

OpenAI Python

pip install openai

OpenAI Node

npm install openai

OpenAI Go

go get github.com/openai/openai-go/v3

Anthropic SDK

Native Claude Messages API support

OpenAI SDK Example

Use this when you are migrating an existing OpenAI-compatible client or want the /v1 compatibility path. For Claude-native or Gemini-native features, use the matching native SDK instead.

OpenAI Go Example

Anthropic SDK Example

Which SDK Should You Use?

Best Practices

Use Anthropic or Gemini native routes for provider-specific fields, tools, streaming details, and other behavior that should not be translated through another format.
OpenAI-compatible SDKs are the best path for existing OpenAI-style clients, portable chat, and embeddings. Treat them as a compatibility route, not as the only AI Sonar API surface.
Pass AI Sonar base URLs directly in your client configuration instead of relying on older environment-variable aliases.