---
title: Anthropic provider
description: Reference for supported capabilities for Anthropic provider
url: "/ai-gateway/ai-providers/anthropic/"
canonical_url: "/ai-gateway/ai-providers/anthropic/"
content_type: reference
min_version:
  ai-gateway: '2.0'
products:
- AI Gateway
tools:
- Konnect API
- kongctl
tags:
- ai
canonical: true
works_on:
- konnect


---

# Anthropic provider











You can proxy requests to Anthropic AI models through AI Gateway by creating [AI Model Provider](/ai-gateway/entities/ai-model-provider/) and [AI Model](/ai-gateway/entities/ai-model/) entities. This reference documents all supported AI capabilities, configuration requirements, and provider-specific details needed for proper integration.

## Upstream paths

AI Gateway automatically routes requests to the appropriate Anthropic API endpoints. The following table shows the upstream paths used for each capability.

### Generate
Path template: `/chat/completions` or `/completions`
Description: Text generation for chat completions
Upstream path or API: `/v1/messages`

### Batches
Path template: `/batches`
Description: Batch processing of requests
Upstream path or API: `/v1/messages/batches`


## Supported capabilities

The following tables show the AI capabilities supported by the Anthropic provider when configuring [AI Models](/ai-gateway/entities/ai-model/).


> By default, AI Gateway uses the path templates shown in the tables below (e.g., `/chat/completions`, `/embeddings`, etc.). To customize these paths, configure the `config.paths` field in your [AI Model](/ai-gateway/entities/ai-model/) entity. Custom paths take the form `{configured_path}/{template_path}` — for example, if you set a custom path of `/v2`, requests to `/embeddings` would be routed to `/v2/embeddings`.



### Text generation

Support for Anthropic text generation capabilities:

#### generate
Streaming: true
Model example: claude-sonnet-4-20250514
Path template: `/chat/completions` or `/completions`
Min version: 2.0






### Batches

Support for Anthropic batch processing capabilities:

#### batches<sup>1</sup>
Model example: n/a
Path template: `/batches`
Min version: 2.0


<sup>1</sup> Batches processing for Anthropic is supported in the native format from SDK only


> Batches are configured on a separate AI Model with `type: "api"`, distinct from regular models that handle synchronous capabilities like generate and embeddings.
> Create a dedicated AI Model exclusively for batches and files, as each model must be either a regular model or an API model, not both.## Anthropic base URL

The base URL is `https://api.anthropic.com:443/{capability_path}`. The `{capability_path}` is determined by the AI capability.


AI Gateway uses this URL automatically. You only need to configure a URL if you're using a self-hosted or Anthropic-compatible endpoint, in which case set the `upstream_url` option in your [AI Model](/ai-gateway/entities/ai-model/) configuration.












## Supported native LLM formats for Anthropic

By default, AI Gateway uses OpenAI-compatible request formats. Configure a native format in your [AI Model](/ai-gateway/entities/ai-model/) to use Anthropic-specific APIs and features.

The following native Anthropic formats are supported:

### `anthropic`
Supported APIs: |
  - `/v1/messages`
  - `/v1/messages/batches`







### Provider-specific limitations for native formats



- Does not support embeddings






### Statistics logging limitations for native formats



- No statistics logging for completions









## Configure Anthropic

To use Anthropic with AI Gateway, configure a new [AI Model Provider](/ai-gateway/entities/ai-model-provider/). You can then access supported [AI Models](/ai-gateway/entities/ai-model/) from Anthropic.

Here's a minimal configuration for chat completions:





### Konnect API

  


```bash
curl -X POST https://{region}.api.konghq.com/v1/ai-gateways/{AIGatewayId}/model-providers \
    --header "accept: application/json" \
    --header "Content-Type: application/json" \
    --header "Authorization: Bearer $KONNECT_TOKEN" \
    --data '
    {
      "display_name": "Anthropic Production",
      "name": "anthropic-provider",
      "type": "anthropic",
      "config": {
        "auth": {
          "type": "basic",
          "headers": [
            {
              "name": "x-api-key",
              "value": "'$ANTHROPIC_API_KEY'"
            }
          ]
        }
      }
    }
    '
```





### kongctl

  


```yaml
ai_gateway_model_providers:
  - ref: anthropic-provider
    ai_gateway: !lookup {id: !env AI_GATEWAY_ID}
    display_name: Anthropic Production
    name: anthropic-provider
    type: anthropic
    config:
      auth:
        type: basic
        headers:
        - name: x-api-key
          value: !secret {source: !env ANTHROPIC_API_KEY}
```
{: data-file="model-provider.yaml" data-tool="kongctl" }





Make sure to replace the following placeholders with your own values:

* `AI_GATEWAY_ID`: The `id` of your AI Gateway.

* `!env ANTHROPIC_API_KEY`: The API key to use to connect to Anthropic.












## Related Resources

- [AI Gateway](/ai-gateway/)

- [AI Gateway Policies](/ai-gateway/policies/)

- [AI Providers](/ai-gateway/ai-providers/)

- [AI Model Provider entity](/ai-gateway/entities/ai-model-provider/)

- [AI Model entity](/ai-gateway/entities/ai-model/)

