AnnexAPI Integration Guide

Last Updated: June 23, 2026Version 1.0.0

Seamlessly configure models, authorization headers, batch pipelines, and integration environments.

01API Compatibility & Auth

AnnexAPI supports standard OpenAI-compatible and provider-native payload structures. This allows you to easily switch model gateways simply by redirecting client configurations.

Gateway Configuration coordinates:
Base URL:https://annexapi.com/v1Auth Header:Authorization: Bearer AE_KEY_YOUR_SECRET

Format Specifications

FormatEndpointHeadersCompatibility
OpenAI Compatible/v1/chat/completions
Authorization: Bearer sk-xxx
Universal endpoint supporting all standard chat models listed in the directory.
OpenAI Responses/v1/responses
Authorization: Bearer sk-xxx
Compatible with new OpenAI chat flow interfaces (supported models only).
Claude Native/v1/messages
x-api-key: sk-xxx
anthropic-version: 2023-06-01
Native Anthropic messages format. Restricted to Claude family models.
Gemini Native/v1/models/...
x-goog-api-key: sk-xxx
Native Google Gemini format. Parameters use camelCase (e.g. imageSize).

02Language SDK Integration

Use standard OpenAI client libraries in Python or Node.js by redirecting the client parameters to AnnexAPI's server.

main.py
# Install the client: pip install openai
import openai

client = openai.OpenAI(
    base_url="https://annexapi.com/v1/",
    api_key="AE_KEY_YOUR_SECRET"
)

completion = client.chat.completions.create(
    model="claude-sonnet-4-6-max",
    messages=[
        {"role": "user", "content": "Explain routing optimization."}
    ]
)
print(completion.choices[0].message.content)

03Client & IDE Integrations

Connect AnnexAPI coordinates with command-line developer tools and terminal assistant clients.

Claude Code CLI Setup

Route Anthropic's official terminal assistant through AnnexAPI endpoints.

Config Setup
// File: ~/.claude.json
{
  "hasCompletedOnboarding": true
}

// File: .claude/settings.json (inside your project directory)
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://annexapi.com",
    "ANTHROPIC_AUTH_TOKEN": "AE_KEY_YOUR_SECRET",
    "ANTHROPIC_MODEL": "claude-sonnet-4-6-max",
    "CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS": 1
  }
}
Steps:
  1. Install Claude Code globally: npm install -g @anthropic-ai/claude-code.
  2. Create ~/.claude.json containing onboarding override settings.
  3. Add a .claude folder inside your project workspace and create settings.json with environment coordinates.
  4. Launch the assistant by executing the 'claude' command in your terminal.

04High-Concurrency Batching

For high-volume operations, use Python's asynchronous aiohttp library to send parallel request queues. Keep limits reasonable to prevent connection reset errors.

concurrency_batch.py
import asyncio
import aiohttp

API_KEY = "AE_KEY_YOUR_SECRET"
BASE_URL = "https://annexapi.com/v1/"

headers = {
    "Authorization": f"Bearer {API_KEY}",
    "Content-Type": "application/json",
}

async def fetch_completion(session):
    try:
        async with session.post(
            url=f"{BASE_URL}chat/completions",
            json={
                "model": "gpt-5.5",
                "max_tokens": 1000,
                "temperature": 0.5,
                "messages": [{"role": "user", "content": "Explain routing optimization."}],
            },
            headers=headers
        ) as response:
            if response.status == 200:
                result = await response.json()
                print(result['choices'][0]['message']['content'])
            else:
                print(f"Request failed: {response.status}")
    except Exception as e:
        print(f"Exception occurred: {e}")

async def main():
    concurrency_limit = 50
    async with aiohttp.ClientSession() as session:
        tasks = [fetch_completion(session) for _ in range(concurrency_limit)]
        await asyncio.gather(*tasks)

if __name__ == "__main__":
    asyncio.run(main())

05Best Practices

Follow these principles to ensure high performance and account security.

Do's

  • Use system environment configs for keys.
  • Handle HTTP 429 using exponential backoffs.
  • Enable streaming options to reduce load latency.

Don'ts

  • Never expose secrets client-side in HTML/browser JS files.
  • Do not flood endpoints without delay timeouts.
  • Abide by upstream moderation and usage policies.

06API Error Codes

Standard HTTP response status codes and platform-specific error messages you may encounter while integrating with AnnexAPI.

Standard HTTP Status Codes

Status CodeExplanation & Recommendations
400 Bad RequestThe request is malformed or cannot be understood by the server. Typically indicates a client-side syntax error or missing mandatory parameters.
401 UnauthorizedAPI key verification failed. Verify that your API key is correct, properly formatted in the header, and has not expired.
402 Payment RequiredInsufficient account balance. A minimum balance of 0.10 Aurea is required to process requests.
403 ForbiddenInsufficient permissions to access the requested resource. This may be caused by locked accounts or key restrictions.
404 Not FoundThe requested resource was not found. Double-check that the endpoint URL is correct and exists on the platform.
413 Payload Too LargeThe request entity is too large. Reduce the batch size, trim the context window, or compress prompt sizes.
429 Too Many RequestsRate limit exceeded. Too many requests were sent in a short window. Implement exponential backoff or request a rate-limit increase.
500 Internal ErrorAn unexpected error occurred on the server. This is often an upstream model provider outage and not a client error.
503 Service UnavailableThe server is temporarily overloaded or undergoing maintenance. Please retry after a brief delay.

Platform Troubleshooting FAQ

Service FaultNo Channels Available for Model
Translated Message: "There are currently no available channels for model 'xxx' in the current group default."
This model has been automatically disabled due to a detected upstream fault. AnnexAPI's self-healing checks usually restore it within a few minutes. If recovery does not happen automatically, please contact support for administrator intervention or switch your query to an equivalent alternative model.