Skip to content

Anthropic Compatibility

Forra provides Anthropic-compatible endpoints that allow you to use Forra with tools that support Anthropic's API format, such as Claude Code, or any library and framework built around the Anthropic SDK. This means you can easily integrate Forra into existing workflows and applications without changing your code.

A key benefit of the Anthropic-compatible endpoints is that available models are retrieved directly from the server. You do not need to manually configure model lists — the server exposes the models available in your Forra instance through the /v1/models endpoint, and tools that support model discovery (such as Claude Code) will fetch them automatically.

Endpoints

https://app.forra-ai.com/api/anthropic_compatible

The base URL exposes the following routes:

Method Path Description
POST /v1/messages Create a message (chat completion)
GET /v1/models List all available models
GET /v1/models/{model_id} Retrieve a specific model
HEAD / Connectivity probe

Configuration Examples

Claude Code Configuration

To use Forra as the provider for Claude Code, add the following environment variables to ~/.claude/settings.json:

{
  "env": {
    "ANTHROPIC_BASE_URL": "https://app.forra-ai.com/api/anthropic_compatible",
    "ANTHROPIC_API_KEY": "your-forra-api-key",
    "CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY": "1"
  }
}

Setting CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY to "1" enables Claude Code to discover available models directly from the Forra server via the /v1/models endpoint. This means the model list stays in sync with your Forra instance — no manual model configuration is needed.

Using with the Anthropic SDK

You can use Forra with the official Anthropic SDK by changing the base URL:

from anthropic import Anthropic

client = Anthropic(
    base_url="https://app.forra-ai.com/api/anthropic_compatible",
    api_key="your-forra-api-key",
)

response = client.messages.create(
    model="claude-sonnet-4",
    max_tokens=1024,
    messages=[
        {"role": "user", "content": "Hello, how can you help me?"}
    ],
)
import Anthropic from '@anthropic-ai/sdk';

const client = new Anthropic({
  baseURL: 'https://app.forra-ai.com/api/anthropic_compatible',
  apiKey: 'your-forra-api-key',
});

const message = await client.messages.create({
  model: 'claude-sonnet-4',
  max_tokens: 1024,
  messages: [{ role: 'user', content: 'Hello, how can you help me?' }],
});

Available Models

Any model available in your Forra instance can be used through the Anthropic-compatible endpoints. Models are retrieved from the server, so the list reflects what is configured in your Forra tenant at any given time.

To fetch the complete list of available models, make a GET request to:

https://app.forra-ai.com/api/anthropic_compatible/v1/models

This returns a JSON response with all available models, their display names, and creation timestamps.

To retrieve a specific model, make a GET request to:

https://app.forra-ai.com/api/anthropic_compatible/v1/models/{model_id}

Authentication

You'll need a valid Forra API key to use these endpoints. To create an API token, go to https://app.forra-ai.com/settings/api-tokens and create a new token.

Supported Features

The Anthropic-compatible endpoints support:

  • Message creation (chat completions)
  • Streaming responses
  • Multiple message roles (system, user, assistant)
  • Model selection
  • Temperature, top_p, stop_sequences, and max_tokens generation parameters
  • Image inputs (base64)
  • Tool use (function calling)
  • Extended thinking (budget-based reasoning effort)
  • Model discovery via /v1/models