Skip to main content

Overview

Anannas provides full compatibility with the Anthropic Messages API format, allowing you to use Anannas with any tool or SDK designed for Anthropic’s API. This includes Claude Code, the official Anthropic SDK, and other tools in the Anthropic ecosystem. The /v1/messages endpoint converts Anthropic Messages API requests to Anannas’ internal format and works with all models that Anannas supports, not just Anthropic models. You can use any model (OpenAI, Google, Anthropic, etc.) through this endpoint by specifying the model in Anannas’ provider/model-name format.

Base URL

The Anannas Anthropic-compatible endpoint is available at:
Alternatively, you can use:

Authentication

All requests require a Bearer token in the Authorization header using your Anannas API key:
Get your API key from the Anannas dashboard.

Model IDs

The /v1/messages endpoint accepts any model that Anannas supports, not just Anthropic models. Specify models using Anannas’ standard provider/model-name format. The API will automatically route to the appropriate provider.

Example Models from Different Providers

OpenAI Models:
  • gpt-4.1-mini
  • gpt-5-mini
Google Models:
  • gemini-2.5-pro
  • gemini-2.5-flash
Other Providers:
  • grok-4-1-fast-non-reasoning-latest
  • mistralai/mistral-large
  • meta-llama/llama-3-70b
  • And many more…
For a complete list of available models, visit anannas.ai/models or query GET https://api.anannas.ai/v1/models.
The endpoint converts Anthropic Messages API format to Anannas’ internal format, allowing you to use any supported model through the Anthropic-compatible interface. Model routing and provider selection are handled automatically.

Using Claude Code

Claude Code is an agentic coding tool that lives in your terminal and helps you code faster through natural language commands. You can configure Claude Code to use Anannas instead of the default Anthropic API.

Step 1: Install Claude Code

If you encounter permission issues during installation, try using sudo (macOS/Linux) or running the command prompt as an administrator (Windows).

Step 2: Configure Environment Variables

Set up environment variables to point Claude Code to Anannas: macOS/Linux:
Windows (PowerShell):
Windows (Command Prompt):
The API_TIMEOUT_MS parameter is configured to prevent excessively long outputs that could cause the Claude Code client to time out. Here, we set the timeout duration to 10 minutes (600000ms).

Step 3: Start Claude Code

Navigate to your project directory and run:
If prompted with “Do you want to use this API key,” select “Yes.” After launching, grant Claude Code permission to access files in your folder. You can now use Claude Code with Anannas.

Model Configuration

Claude Code uses internal model environment variables that map to specific models. The default configuration maps:
  • ANTHROPIC_DEFAULT_OPUS_MODEL: Maps to Claude Code’s “opus” tier (most capable)
  • ANTHROPIC_DEFAULT_SONNET_MODEL: Maps to Claude Code’s “sonnet” tier (balanced)
  • ANTHROPIC_DEFAULT_HAIKU_MODEL: Maps to Claude Code’s “haiku” tier (fastest)
You can customize these mappings to use any Anannas-supported model. For example, you could use OpenAI models:
Or mix providers:
Alternatively, you can configure model mappings in Claude Code’s settings file (~/.claude/settings.json):
It is generally not recommended to manually adjust the model mapping, as hardcoding the model mapping makes it inconvenient to automatically update to the latest model when Anannas adds new models. If you want to use the latest default mappings, simply delete the model mapping configuration in settings.json.

Using the Anthropic SDK

You can use the official Anthropic SDK with Anannas by configuring the base URL.

Step 1: Install the Anthropic SDK

Python:
Node.js:

Step 2: Configure the Client

Python:
Node.js:

Step 3: Make API Calls

Python:
Node.js:

Direct HTTP Requests

You can also make direct HTTP requests to the endpoint:

API Compatibility Details

HTTP Headers

Request Fields

Tool Fields

Tool Choice Values

Message Content Types

Response Format

Responses follow the Anthropic Messages API format:

Streaming

When stream: true is set, the API returns Server-Sent Events (SSE) with the following event types:
  • message_start: Initial message metadata
  • content_block_start: Start of a content block
  • content_block_delta: Incremental content updates
  • content_block_stop: End of a content block
  • message_delta: Message-level updates (stop_reason, usage)
  • message_stop: End of the message stream
  • ping: Keep-alive heartbeat events
  • error: Error events

Troubleshooting

Claude Code Configuration Not Working

If you manually modified the ~/.claude/settings.json configuration file but found the changes did not take effect:
  1. Close all Claude Code windows, open a new command-line window, and run claude again
  2. If the issue persists, try deleting the ~/.claude/settings.json file and then reconfigure the environment variables
  3. Confirm that the JSON format of the configuration file is correct - check variable names and ensure there are no missing or extra commas

Model Not Found Errors

If you receive a “model not found” error:
  1. Verify the model ID format is correct: provider/model-name (e.g., grok-4-1-fast-non-reasoning-latest, anthropic/claude-3.7-sonnet)
  2. Check available models at anannas.ai/models or via GET https://api.anannas.ai/v1/models
  3. Ensure your API key has access to the requested model
  4. Remember: you can use any model supported by Anannas, not just Anthropic models

Authentication Errors

If you receive authentication errors:
  1. Verify your API key is correct and active in the Anannas dashboard
  2. Ensure you’re using Authorization: Bearer <ANANNAS_API_KEY> header format
  3. Check that your API key has sufficient credits

Next Steps