1
Create an API key
2
Save the key in your environment
The examples read the key from
NAGA_API_KEY, so it stays out of your code.3
Install the OpenAI SDK
4
Send a request
Point the SDK at The model answers in one sentence:The request goes to the Responses API. The SDK collects the answer text in
https://api.naga.ac/v1 and run the code:output_text. In raw JSON, the text is the output_text part of the message item in output.Troubleshooting
KeyError: 'NAGA_API_KEY' or a missing API key
The code runs in a shell where NAGA_API_KEY isn’t set. Run the export command from the second step in the same terminal, then run the code again.
401
The key is wrong, disabled or expired, or it is a provisioning key. Create an API key on the API Keys page.402 insufficient_quota
The balance is too low for a paid model. Top up on the Credits page, or switch the code to a :free model.