> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://respan.ai/docs/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://respan.ai/docs/_mcp/server.

# Provider: AI21 Labs

> **Note**
>
> This page is for **Respan LLM Gateway** users.

## Model availability

AI21 Labs has no models marked live in the current [Gateway model catalog](https://platform.respan.ai/platform/models). There is no public catalog model ID to use in a Gateway request example for this provider.

The provider is available in the [Bring your own key settings](https://platform.respan.ai/platform/gateway/api-keys?providers=1), but adding credentials does not make a model available. Before sending Gateway requests, confirm a model configuration for your project or request a model from the catalog page.

## Billing

AI21 Labs requires your own provider credentials (BYOK). Provider usage is billed to your AI21 Labs account, not Respan credits. Your Respan API key authenticates Gateway requests after the provider credentials and model are configured.

## Use your own AI21 Labs key (BYOK)

Gateway use requires your own AI21 Labs credentials. Store them in Respan or pass them per request. Adding credentials does not by itself make a model available.

#### Global (UI)

#### Open Providers

Go to the [Providers page](https://platform.respan.ai/platform/gateway/api-keys?providers=1).

#### Add AI21 Labs

Select **AI21 Labs** and enter your API key. The provider credential ID is `ai21_labs`.

#### Load balancing (Optional)

Add multiple credential sets and use **Load balancing weight** to distribute traffic across them.

#### Per-request (Code)

Pass `customer_credentials` on each [Gateway request](/docs/apis/gateway/create-chat-completion). Useful when serving end-user keys.

```json
{
  "customer_credentials": {
    "ai21_labs": {
      "api_key": "YOUR_AI21LABS_API_KEY"
    }
  }
}
```

## Log direct AI21 Labs calls

If you call AI21 Labs directly, use your provider credentials and the model identifier returned by AI21 Labs. Send logs to Respan separately using the [logging guide](/docs/apis/spans/create-span). Direct provider calls do not use the Respan Gateway catalog or Respan credits.