# Overview

**Infron provides Anthropic-compatible API endpoints**, so you can use the Anthropic SDK and tools like [Claude Code](https://www.claude.com/product/claude-code) through a unified gateway with only a URL change.

The Anthropic-compatible API implements the same specification as the [Anthropic Messages API](https://docs.anthropic.com/en/api/messages).

For more on using Infron with Claude Code, see the [Claude Code instructions](https://vercel.com/docs/agent-resources/coding-agents/claude-code).

### Base URL

The Anthropic-compatible API is available at the following base URL:

`https://llm.onerouter.pro`

### Authentication

The OpenAI-compatible API supports the same authentication methods:

* **API key**: Use your Infron API key with the `Authorization: Bearer <token>` header

### Integration with existing tools <a href="#integration-with-existing-tools" id="integration-with-existing-tools"></a>

You can use the Infron's **Anthropic-compatible API** with existing tools and libraries like the **Anthropic Claude** **client libraries**. Point your existing client to the Infron's base URL and use your Infron API key for authentication.

### Integration with Anthropic SDK

{% tabs %}
{% tab title="Python(Anthropic SDK) " %}

```python
import anthropic

client = anthropic.Anthropic(
    base_url="https://llm.onerouter.pro",
    api_key="<<Your API Key>>"
)

message = client.messages.create(
    model="anthropic/claude-sonnet-4.5",
    max_tokens=1000,
    temperature=1,
    system=[
        {
            "type": "text",
            "text": "You are a world-class poet. Respond only with short poems."
        }
    ],
    messages=[
        {
            "role": "user",
            "content": [
                {
                    "type": "text",
                    "text": "Why is the ocean salty?"
                }
            ]
        }
    ]
)

print(message.content)
```

{% endtab %}
{% endtabs %}

{% content-ref url="<https://app.gitbook.com/s/Z9C9AjT7j46HAcQrOVWw/frameworks-and-integrations/anthropic-sdk-compatibility>" %}
[Anthropic SDK Compatibility](https://app.gitbook.com/s/Z9C9AjT7j46HAcQrOVWw/frameworks-and-integrations/anthropic-sdk-compatibility)
{% endcontent-ref %}

#### Configuring Claude Code

{% content-ref url="<https://app.gitbook.com/s/Z9C9AjT7j46HAcQrOVWw/frameworks-and-integrations/claude-code-integration-guide>" %}
[Claude Code Integration Guide](https://app.gitbook.com/s/Z9C9AjT7j46HAcQrOVWw/frameworks-and-integrations/claude-code-integration-guide)
{% endcontent-ref %}

### Error handling

The API returns standard HTTP status codes and error responses:

#### Common error codes

* **400**: Bad Request (invalid or missing params, CORS)
* **401**: Invalid credentials (OAuth session expired, disabled/invalid API key)
* **402**: Your account or API key has insufficient credits. Add more credits and retry the request.
* **403**: Your chosen model requires moderation and your input was flagged
* **408**: Your request timed out
* **429**: You are being rate limited
* **502**: Your chosen model is down or we received an invalid response from it
* **503**: There is no available model provider that meets your routing requirements

#### Error response format

```json
{
    "error": {
        "message": "",
        "type": "",
        "param": "",
        "code": 429
    }
}
```
