LLM
Introduction
We provide compatibility with the OpenAI API standard, allowing for easier integration into existing applications.
Base URL
The APIs we support are:
- Chat Completion, both streaming and regular.
- Completion, both streaming and regular.
The Models we support are:
You can find all the models we support here: https://novita.ai/llm-api or request the List Models API to get all available models.
Example with Python Client
- Chat Completions API
- Completions API
Example with Curl Client
- Chat Completions API
- Completions API
If you’re already using OpenAI’s chat completion endpoint, you can simply set the base URL to https://api.novita.ai/v3/openai
, obtain and set your API Key (detailed instructions are available at https://novita.ai/guides/quickstart#_2-manage-api-key), and update the model name according to your needs. With these steps, you’re good to go.
Error codes
If the response status code is not 200, we will return the error code and message in JSON format in the response body. The format is as follows:
Code | Reason | Description |
---|---|---|
401 | INVALID_API_KEY | The API key is invalid. You can check your API key here: Manage API Key |
403 | NOT_ENOUGH_BALANCE | Your credit is not enough. You can top up more credit here: Top Up Credit |
404 | MODEL_NOT_FOUND | The requested model is not found. You can find all the models we support here: https://novita.ai/llm-api or request the List models API to get all available models. |
429 | RATE_LIMIT_EXCEEDED | You have exceeded the rate limit. Please refer to Rate limits for more information. |
500 | MODEL_NOT_AVAILABLE | The requested model is not available now. This is usually due to the model being under maintenance. You can contact us on Discord for more information. |
Was this page helpful?