Documentation Index
Fetch the complete documentation index at: https://docs.anannas.ai/llms.txt
Use this file to discover all available pages before exploring further.
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:Authentication
All requests require a Bearer token in theAuthorization header using your Anannas API key:
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-minigpt-5-mini
gemini-2.5-progemini-2.5-flash
grok-4-1-fast-non-reasoning-latestmistralai/mistral-largemeta-llama/llama-3-70b- And many more…
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: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: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)
~/.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:Step 2: Configure the Client
Python:Step 3: Make API Calls
Python:Direct HTTP Requests
You can also make direct HTTP requests to the endpoint:API Compatibility Details
HTTP Headers
| Field | Support Status |
|---|---|
anthropic-beta | Ignored |
anthropic-version | Ignored |
x-api-key | Fully Supported (use Authorization: Bearer instead) |
Authorization | Fully Supported |
Request Fields
| Field | Support Status | Notes |
|---|---|---|
model | Fully Supported | Use any Anannas model format (e.g., grok-4-1-fast-non-reasoning-latest, anthropic/claude-4.5-sonnet, gemini-2.5-pro) |
max_tokens | Fully Supported | Required field |
messages | Fully Supported | Required field, minimum 1 message |
system | Supported | String or array of system blocks (cache_control in array blocks is not preserved) |
temperature | Fully Supported | Range [0.0 ~ 2.0] |
top_p | Fully Supported | Range [0.0 ~ 1.0] |
top_k | Ignored | Not supported by all models. Not allowed when thinking is enabled |
stop_sequences | Fully Supported | Array of stop sequences |
stream | Fully Supported | Server-Sent Events (SSE) |
tools | Fully Supported | Tool definitions for function calling |
tool_choice | Fully Supported | none, auto, any, or specific tool. When thinking is enabled, only "auto" or "none" are allowed |
thinking | Supported | budget_tokens is converted to reasoning.max_tokens. Interleaved thinking is automatically enabled when tools are present and tool_choice is "auto" |
metadata | Partially Supported | user_id is supported |
Tool Fields
| Field | Support Status | |
|---|---|---|
name | Fully Supported | |
description | Fully Supported | |
input_schema | Fully Supported | |
cache_control | Supported | Prompt caching support for tools |
Tool Choice Values
| Value | Support Status | Notes |
|---|---|---|
none | Fully Supported | |
auto | Supported | disable_parallel_tool_use is ignored. Required for interleaved thinking when thinking is enabled |
any | Supported | disable_parallel_tool_use is ignored. Not allowed when thinking is enabled |
tool | Supported | disable_parallel_tool_use is ignored. Not allowed when thinking is enabled |
Message Content Types
| Content Type | Support Status | Notes |
|---|---|---|
text | Fully Supported | String or content block |
image | Supported | Base64-encoded images |
tool_use | Fully Supported | Tool call from assistant |
tool_result | Fully Supported | Tool result from user |
thinking | Supported | Reasoning/thinking blocks |
document | Not Supported | |
search_result | Not Supported | |
redacted_thinking | Supported | Redacted/encrypted thinking blocks are supported and preserved |
server_tool_use | Not Supported | |
mcp_tool_use | Not Supported |
Response Format
Responses follow the Anthropic Messages API format:Streaming
Whenstream: true is set, the API returns Server-Sent Events (SSE) with the following event types:
message_start: Initial message metadatacontent_block_start: Start of a content blockcontent_block_delta: Incremental content updatescontent_block_stop: End of a content blockmessage_delta: Message-level updates (stop_reason, usage)message_stop: End of the message streamping: Keep-alive heartbeat eventserror: 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:
- Close all Claude Code windows, open a new command-line window, and run
claudeagain - If the issue persists, try deleting the
~/.claude/settings.jsonfile and then reconfigure the environment variables - 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:- Verify the model ID format is correct:
provider/model-name(e.g.,grok-4-1-fast-non-reasoning-latest,anthropic/claude-3.7-sonnet) - Check available models at anannas.ai/models or via
GET https://api.anannas.ai/v1/models - Ensure your API key has access to the requested model
- Remember: you can use any model supported by Anannas, not just Anthropic models
Authentication Errors
If you receive authentication errors:- Verify your API key is correct and active in the Anannas dashboard
- Ensure you’re using
Authorization: Bearer <ANANNAS_API_KEY>header format - Check that your API key has sufficient credits
Next Steps
- Explore Streaming for real-time responses
- Learn about Tool Calling for function execution
- Review Reasoning for thinking/reasoning capabilities
- Check Authentication for security best practices