Before you start
You need a NagaAI API key exported asNAGA_API_KEY, and the SDK packages:
Connect the AI SDK
1
Run a request in each format
/messages to its base URL, so its baseURL ends in /v1.2
Check the requests
Both requests appear in Logs in your dashboard.
Use Chat Completions
Use Chat Completions only for code that needs it, such as a tool built on that format.naga.chat("anthropic/claude-haiku-5.5") sends the same request to /v1/chat/completions. createOpenAICompatible from @ai-sdk/openai-compatible also works with baseURL: "https://api.naga.ac/v1". Set includeUsage: true there to get token usage in streams.
Troubleshooting
400 on the second turn
The OpenAI provider sent a reference to a stored response, and NagaAI keeps none. SetproviderOptions: { openai: { store: false } } on the call.
401 invalid_api_key
NAGA_API_KEY is missing or wrong in the environment that runs your code. Use an API key rather than a provisioning key.