Skip to main content
NagaAI has two kinds of keys. Both look the same, ng- followed by 32 characters, and neither works in place of the other. GET /v1/models and GET /v1/startups need no key.

Model endpoints

Send the API key in either header. If a request carries a Bearer token and x-api-key, NagaAI uses the Bearer token.
OpenAI SDKs send Authorization: Bearer. The Anthropic SDK sends x-api-key. Both work on every model endpoint, including /v1/messages.

Account endpoints

/v1/account/* accepts only a provisioning key, and only as Authorization: Bearer. The OpenAI and Anthropic SDKs have no methods for these endpoints, so call them over HTTP.
The balance is a decimal string, for example "22.2782894050", so it keeps every digit.

401 errors

The error name is in error.type. On /v1/messages every row below arrives as error.type: "authentication_error", and the message tells them apart. Keep keys on your server. A key in browser or mobile code can be copied by anyone who opens the app.