# Novita AI

[Novita AI](https://novita.ai/docs/api-reference/model-apis-llm-create-chat-completion) provides hosted inference for a catalog of language models. Applications select those models through stable AISIX aliases and authenticate with gateway-issued caller keys.

## Prerequisites[​](#prerequisites "Direct link to Prerequisites")

Before starting, prepare the following:

* One AISIX setup:

  <!-- -->

  * For AISIX Enterprise or AISIX Cloud, an environment with an attached gateway and a write-scoped admin token. For AISIX Enterprise, follow the [AISIX Enterprise getting-started guide](https://docs.api7.ai/ai-gateway/getting-started/aisix-cloud-quickstart.md). To request AISIX Cloud access, [contact API7](https://api7.ai/contact).
  * For the open-source AISIX gateway, prepare either a local AISIX installation or the Docker setup from the [AISIX OSS getting-started guide](https://docs.api7.ai/ai-gateway/getting-started/gateway-quickstart.md). Configure the gateway to load a declarative resources file.

* A Novita AI API key.

* `curl` and `jq`.

## Configure with AISIX Enterprise or AISIX Cloud[​](#configure-with-aisix-enterprise-or-aisix-cloud "Direct link to Configure with AISIX Enterprise or AISIX Cloud")

Export the control-plane connection details:

```
# AISIX_CP is the Admin API base URL; include /api and omit a trailing slash

# The local AISIX Enterprise quickstart uses http://localhost:8080/api

export AISIX_CP="YOUR_AISIX_CONTROL_PLANE_API_URL"

export AISIX_TOKEN="YOUR_ADMIN_TOKEN"

export ENV_ID="YOUR_ENVIRONMENT_ID"
```

Novita AI is a community catalog provider with an OpenAI-compatible API. AISIX connects through the `openai` adapter and authenticates upstream requests with a bearer token.

### Create a Provider Key[​](#create-a-provider-key "Direct link to Create a Provider Key")

```
export NOVITA_API_KEY="YOUR_NOVITA_API_KEY"



PROVIDER_KEY_ID=$(

  curl -sS -X POST "$AISIX_CP/provider_keys" \

    -H "Authorization: Bearer $AISIX_TOKEN" \

    -H "Content-Type: application/json" \

    -d '{

      "display_name": "novita-prod",

      "provider": "novita-ai",

      "api_key": "'"${NOVITA_API_KEY}"'",

      "api_base": "https://api.novita.ai/openai/v1",

      "allowed_environments": ["'"${ENV_ID}"'"]

    }' | jq -er '.provider_key.id'

)



echo "$PROVIDER_KEY_ID"
```

The provider ID includes the `-ai` suffix. `novita` is not the AISIX catalog ID.

The API base must include `/openai`. This guide uses Novita's documented `/openai/v1` root, so AISIX appends `/chat/completions` to produce `https://api.novita.ai/openai/v1/chat/completions`. Novita also accepts `/openai` without the version segment, which is the current synchronized catalog value. Using the bare host would send traffic to a route Novita does not document for LLM inference.

AISIX derives the `openai` adapter for this catalog provider. Omit `adapter` from the request.

### Create a Model[​](#create-a-model "Direct link to Create a Model")

Create an alias with Novita's publisher-namespaced model ID:

```
MODEL_ID=$(

  curl -sS -X POST "$AISIX_CP/environments/$ENV_ID/models" \

    -H "Authorization: Bearer $AISIX_TOKEN" \

    -H "Content-Type: application/json" \

    -d '{

      "display_name": "novita-deepseek-prod",

      "model_name": "deepseek/deepseek-v3.2",

      "provider_key_id": "'"${PROVIDER_KEY_ID}"'"

    }' | jq -er '.model.id'

)



echo "$MODEL_ID"
```

Model IDs and availability change as the catalog from Novita is updated. Copy the current ID, including its publisher prefix and casing, from the Novita model list.

### Create a Caller API Key[​](#create-a-caller-api-key "Direct link to Create a Caller API Key")

```
AISIX_API_KEY=$(

  curl -sS -X POST "$AISIX_CP/environments/$ENV_ID/api_keys" \

    -H "Authorization: Bearer $AISIX_TOKEN" \

    -H "Content-Type: application/json" \

    -d '{

      "display_name": "novita-caller",

      "allowed_models": ["'"${MODEL_ID}"'"]

    }' | jq -er '.plaintext'

)



echo "$AISIX_API_KEY"
```

## Configure with AISIX OSS[​](#configure-with-aisix-oss "Direct link to Configure with AISIX OSS")

Export the upstream credential and choose the caller API key that applications will send to the gateway:

```
export NOVITA_API_KEY="YOUR_PROVIDER_API_KEY"

export CALLER_API_KEY="YOUR_CALLER_API_KEY"

export CALLER_API_KEY_SHA256="$(printf '%s' "$CALLER_API_KEY" | sha256sum | cut -d ' ' -f 1)"
```

For a new gateway, use this complete resources file. For an existing gateway, merge the entries into its [current file](https://docs.api7.ai/ai-gateway/reference/resources-file.md#apply-resource-examples-safely), preserving its other resources:

resources.yaml

```
_format_version: "2"



provider_keys:

  - id: 68dc90f0-90d9-4943-b329-cbc26068557c

    display_name: "novita-prod"

    provider: "novita-ai"

    adapter: "openai"

    api_key: ${NOVITA_API_KEY}

    api_base: "https://api.novita.ai/openai/v1"



models:

  - id: 33f07790-b666-4db7-8da4-dd8a0352c8f4

    display_name: "novita-deepseek-prod"

    provider: "novita-ai"

    model_name: "deepseek/deepseek-v3.2"

    provider_key_id: 68dc90f0-90d9-4943-b329-cbc26068557c



api_keys:

  - id: 9b482f67-12fb-44b5-85bb-3e1319586aaa

    display_name: "novita-caller"

    key_hash: ${CALLER_API_KEY_SHA256}

    allowed_models:

      - "novita-deepseek-prod"
```

If AISIX is installed locally, validate the file before loading it:

```
aisix validate --resources resources.yaml
```

After validation, start the gateway with the referenced environment variables in its process environment. Reload an existing gateway only if those variables are already available to the process; otherwise, restart it with the updated environment.

If you use Docker, adapt the validation and startup commands in the [AISIX OSS getting-started guide](https://docs.api7.ai/ai-gateway/getting-started/gateway-quickstart.md). Mount this `resources.yaml` file and pass every environment variable it references with `-e` in both commands. After the resources load, prepare the shared verification request below:

```
export AISIX_API_KEY="$CALLER_API_KEY"
```

## Verify the Provider Connection[​](#verify-the-provider-connection "Direct link to Verify the Provider Connection")

Export the AISIX gateway origin:

```
# AISIX_PROXY has no trailing slash or endpoint path

# The local quickstarts use http://127.0.0.1:3000

export AISIX_PROXY="YOUR_AISIX_GATEWAY_URL"
```

Send a chat-completions request through the AISIX proxy:

```
curl -sS -X POST "$AISIX_PROXY/v1/chat/completions" \

  -H "Authorization: Bearer $AISIX_API_KEY" \

  -H "Content-Type: application/json" \

  -d '{

    "model": "novita-deepseek-prod",

    "messages": [

      {

        "role": "user",

        "content": "Say hello from Novita AI."

      }

    ]

  }'
```

AISIX forwards `deepseek/deepseek-v3.2` to the Novita OpenAI-compatible chat endpoint with the Novita API key.

## Review Model Capabilities[​](#review-model-capabilities "Direct link to Review Model Capabilities")

The `deepseek/deepseek-v3.2` model in this guide is current, text-only, and supports reasoning, function tools, and structured output. Novita's chat API also supports model-specific image, video, and audio input, text or audio output, and controls such as `enable_thinking` and `separate_reasoning`. AISIX forwards typed content blocks, tools, structured-output configuration, and unknown top-level request fields to the OpenAI-compatible upstream.

AISIX normalizes Novita's `reasoning_content` field on chat responses. It does not preserve the optional `reasoning_details` array that some Novita models require for interleaved thinking across tool calls. Use a passthrough route for those models and replay the complete native assistant message. Novita also accepts `n` greater than `1`, and `/v1/chat/completions` returns every choice, while `/v1/messages` and `/v1/responses` return the first.

## Endpoint Coverage[​](#endpoint-coverage "Direct link to Endpoint Coverage")

| Route                                    | Behavior with a Novita alias                                                                                                                                                                                                                                                                                                                                           |
| ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `/v1/chat/completions`                   | Supported, including streaming, tools, structured output, reasoning, and multimodal content supported by the selected model.                                                                                                                                                                                                                                           |
| `/v1/completions`                        | Supported through the `openai` adapter for a compatible Novita model.                                                                                                                                                                                                                                                                                                  |
| `/v1/responses`                          | Supported through the [Responses bridge](https://docs.api7.ai/ai-gateway/endpoints/responses-api.md), which translates to chat completions. Novita does not publish a native Responses route on this API root. Fields without a chat equivalent are ignored, and Novita reasoning is not preserved in the returned Responses output.                                   |
| `/v1/messages`                           | Supported through Anthropic-to-chat translation against the OpenAI-compatible root. The bridge returns Novita `reasoning_content` as unsigned Anthropic `thinking` blocks and replays `thinking` history as `reasoning_content`; it does not carry `reasoning_details`. `/v1/messages/count_tokens` requires an Anthropic-backed model and rejects this configuration. |
| `/v1/embeddings`                         | Supported with a separate alias for a Novita embedding model served on this root.                                                                                                                                                                                                                                                                                      |
| `/v1/files` and `/v1/batches`            | Supported through the `openai` adapter. AISIX rewrites returned file and batch IDs so normalized follow-up calls route to the same alias. Each request in an uploaded batch JSONL file must use the upstream Novita model ID; AISIX does not rewrite file contents, and Novita requires one model per batch file.                                                      |
| `/v1/fine_tuning/jobs` and `/v1/audio/*` | Not supported. Novita does not publish compatible routes beneath the configured OpenAI root. Audio input or output through compatible chat models is a separate capability.                                                                                                                                                                                            |
| `/v1/images/generations`                 | Rejected with `400` because the normalized route accepts only models whose provider is `openai` or whose provider key uses the `azure-openai` adapter (see [Provider Requirement](https://docs.api7.ai/ai-gateway/endpoints/image-generation.md#provider-requirement)). Novita's image-generation APIs use separate host-root paths outside the configured API base.   |
| `/v1/rerank`                             | Rejected with `400` because the normalized route does not accept `novita-ai`. Novita's native `/openai/v1/rerank` route is reachable through a passthrough route.                                                                                                                                                                                                      |
| `/v1/videos`                             | Rejected with `501 not_implemented` because the normalized route does not support `novita-ai`. Novita's video-generation APIs use separate host-root paths outside the configured API base; video input to a compatible chat model is a separate capability.                                                                                                           |
| `/passthrough/novita-ai/*`               | Available through a configured [passthrough route](https://docs.api7.ai/ai-gateway/endpoints/provider-passthrough.md) for Novita-native routes beneath the route's `target_url`, including `/rerank` and `/models`.                                                                                                                                                    |

File and batch management calls record zero tokens. When a normalized batch retrieval first observes a completed job, AISIX downloads the output file and attributes its aggregate token usage and calculated cost to the routing alias.

Novita also publishes an Anthropic-compatible API at `https://api.novita.ai/anthropic`. That sibling root is outside the `/openai/v1` root used in this guide, so a passthrough route targeting the OpenAI-compatible root cannot reach it. Native Anthropic use requires a separate passthrough route with that root as its `target_url`, granted on the caller key's `allowed_routes`.

A passthrough route stays beneath its `target_url`, so a route targeting the `/openai/v1` root cannot reach Novita's host-root `/v3` image, video, or audio APIs. For reachable paths, it does not rewrite an AISIX model alias or resource ID. For the request shapes that record token usage, see [Envelope Detection and Usage](https://docs.api7.ai/ai-gateway/endpoints/provider-passthrough.md#envelope-detection-and-token-usage). AISIX relays provider responses and SSE incrementally rather than buffering them.

The `/passthrough/novita-ai` paths on this page assume a [passthrough route](https://docs.api7.ai/ai-gateway/endpoints/provider-passthrough.md) claiming that prefix with `https://api.novita.ai/openai/v1` as its `target_url` and the Novita provider key for credential injection; grant the route name on the caller key's `allowed_routes`. A route binds one target and credential, so use separate routes for different Novita accounts or roots.

## Troubleshooting[​](#troubleshooting "Direct link to Troubleshooting")

| Symptom                             | Check                                                                                       |
| ----------------------------------- | ------------------------------------------------------------------------------------------- |
| Upstream authentication error       | Confirm `NOVITA_API_KEY` is active.                                                         |
| Upstream `404`                      | Keep `/openai` in `api_base`, and verify that the requested route exists beneath that root. |
| Model not found                     | Copy the complete publisher-namespaced model ID from Novita.                                |
| Provider key creation returns `400` | Use `provider: "novita-ai"` and omit `adapter`.                                             |

## Next Steps[​](#next-steps "Direct link to Next Steps")

You have now connected AISIX to Novita AI and verified the model alias. Continue with these guides:

* [Model Aliases](https://docs.api7.ai/ai-gateway/models/model-aliases.md): configure routing, retry behavior, or cost metadata for the alias.
* [Provider-Specific Overrides](https://docs.api7.ai/ai-gateway/models/provider-keys.md#configure-provider-specific-overrides): adapt request and response shapes when Novita differs from the `openai` adapter.
* [Passthrough Routes](https://docs.api7.ai/ai-gateway/endpoints/provider-passthrough.md): reach Novita-native routes that AISIX does not normalize.
* [Provider Compatibility](https://docs.api7.ai/ai-gateway/providers/compatibility.md): review supported proxy endpoints and provider-specific boundaries.
