1. Sign in or create an account
Sign in to novita.ai. You can use Google or GitHub authentication, or sign up with your email address.2. Create an API key
Novita AI authenticates API requests with a Bearer API key. Open Key Management to create or manage a key, then follow API Keys to store it safely. Pass your API key only through theNOVITA_API_KEY environment variable in these examples. Do not put a real API key in source code, documentation, agent chats, analytics, screenshots, or logs.
3. Confirm available credit
Check your available credit on Billing and Payments before sending a request. Product credit and model access can affect whether a request succeeds. For longer-running use, see Automatic Top-up.4. Send your first LLM request
Complete the account, API key, and credit steps above before running this example. It uses the OpenAI-compatible chat completions endpoint and thedeepseek/deepseek-v4.1-flash model:
200 and a non-empty choices[0].message.content value, such as "Hello!". The exact wording can vary by model. Add --include to the cURL command to inspect the HTTP status as well as the response body. An HTTP 200 alone does not confirm a valid model response.
If the request fails, use the matching guide:
401 Unauthorized: check the key format and API key configuration.403 Forbidden: the Novita gateway may returnINVALID_API_KEYfor a missing or invalid key; check the key first. For a model access error, check model access and whether identity verification is required.429 Too Many Requests: check rate limits.5xx: check common error codes and retry guidance.
5. Use your agent
Your agent can help you create the request and integrate Novita AI. Complete the account, API key, and credit steps above, and makeNOVITA_API_KEY available in the environment where the agent runs the code. Ask it to read the Novita AI skill:
200 with non-empty choices[0].message.content. If the agent path does not work, return to the manual request.
6. Troubleshooting
If you cannot complete the first request, check these in order:- The
NOVITA_API_KEYenvironment variable is set in the current shell. - The key is active and has access to
deepseek/deepseek-v4.1-flash. - Your account has available credit and has completed any required verification.
- The endpoint, model ID, and request body match the example.
- The returned status code is covered by Common Error Codes.