Guide

Getting Started with Aniron — First Request in 5 Minutes

This guide walks you through making your first request to Aniron in under 5 minutes. You will sign up, get an API key, configure the OpenAI SDK to point at Aniron, make a request, and verify the response. By the end, you will have called a model through Aniron and proven the integration works.

Prerequisites

  • Node.js 18+ or Python 3.8+ (whichever you prefer)
  • OpenAI SDK installed (npm install openai or pip install openai)
  • A credit card (for topping up prepaid credits, $10 minimum)

Step 1: Sign up and top up

Go to app.aniron.ai and create an account. Use any email — no verification required to get started.

Once signed in, click Add Credits in the top nav. The minimum top-up is $10. Use Stripe to pay. The $10 becomes your prepaid balance — it covers all models, all requests, until you spend it down.

Your balance appears in the top-right corner. This number decreases as you make requests. When it hits zero, requests stop.

Step 2: Generate an API key

Click API Keys in the sidebar, then Create Key.

Give it a name (e.g., “dev-key” or “quickstart”). Optionally set a per-key budget if you want to cap this specific credential (useful for dev keys or keys shared with contractors). Leave it blank to inherit the full account balance.

Click Create. The key appears once — copy it now. It starts with sk-aniron- and is ~40 characters long. Save it in your environment:

export ANIRON_KEY="sk-aniron-abc123..."

Step 3: Configure your SDK

Aniron speaks the OpenAI chat completions API. Point your existing OpenAI SDK at api.aniron.ai by setting the baseURL parameter.

TypeScript/JavaScript:

import OpenAI from 'openai';

const client = new OpenAI({
  baseURL: 'https://api.aniron.ai/v1',
  apiKey: process.env.ANIRON_KEY,
});

Python:

from openai import OpenAI

client = OpenAI(
    base_url="https://api.aniron.ai/v1",
    api_key=os.environ["ANIRON_KEY"],
)

That is the only change. Everything else — request format, response shape, streaming, tool calls — works identically to OpenAI direct.

Step 4: Make your first request

Call chat.completions.create with a model string prefixed by the provider. For example, anthropic/claude-sonnet-4 or openai/gpt-4o.

TypeScript:

const completion = await client.chat.completions.create({
  model: 'anthropic/claude-sonnet-4',
  messages: [
    { role: 'user', content: 'Explain how TCP handles packet loss.' }
  ],
  max_tokens: 500,
});

console.log(completion.choices[0].message.content);

Python:

completion = client.chat.completions.create(
    model="anthropic/claude-sonnet-4",
    messages=[
        {"role": "user", "content": "Explain how TCP handles packet loss."}
    ],
    max_tokens=500,
)

print(completion.choices[0].message.content)

cURL:

curl https://api.aniron.ai/v1/chat/completions \
  -H "Authorization: Bearer $ANIRON_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "anthropic/claude-sonnet-4",
    "messages": [{"role": "user", "content": "Explain how TCP handles packet loss."}],
    "max_tokens": 500
  }'

Run it. If everything is configured correctly, you get a JSON response with the model’s answer in choices[0].message.content.

Step 5: Verify the response

The response object follows the OpenAI schema:

{
  "id": "chatcmpl-...",
  "object": "chat.completion",
  "created": 1692901234,
  "model": "anthropic/claude-sonnet-4",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "TCP handles packet loss through..."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 15,
    "completion_tokens": 120,
    "total_tokens": 135
  }
}

Check your balance at app.aniron.ai. It should have decreased by the cost of this request (tokens × model rate). For Claude Sonnet 4, that is ~$0.00045 for a 15-token prompt and 120-token response.

Troubleshooting

Error: 401 Unauthorized

Your API key is invalid or not set. Check that ANIRON_KEY is exported in your shell and starts with sk-aniron-. Regenerate the key if needed.

Error: 402 Payment Required

Your account balance is zero. Top up at app.aniron.ai → Add Credits. Minimum is $10.

Error: 400 Bad Request — “model not found”

The model string is invalid. Use the format provider/model-slug, e.g., anthropic/claude-sonnet-4 or openai/gpt-4o. Check /models for the full list.

Response is empty or truncated

Set max_tokens higher. The default varies by SDK but is often too low for complete answers. Try 1000-2000 for paragraph-length responses.

Streaming does not work

Set stream: true in the request. The SDK handles server-sent events automatically. If you are using cURL, pipe to a streaming parser or use --no-buffer.

What to set up next

  • Fallback routing: Set backup models per request. If the primary model is rate-limited, Aniron retries with the fallback automatically. See Model Fallbacks.
  • Per-key budgets: Cap spend per credential. Useful for dev keys, staging, or keys distributed to external users. See Per-Key Budgets.
  • Usage monitoring: Poll GET /v1/usage for real-time token counts and spend. Set alerts when you hit 80% of your balance. See Usage Dashboard.

Claude Sonnet 4 — Mid-tier model with 200K context, $3/M input tokens.

Model Comparison — Compare GPT-4o vs Claude Sonnet 4 pricing and capabilities.

Migrate from OpenAI — Switch from OpenAI direct to Aniron in 3 lines of code.

Prepaid Billing Explained — Why prepaid prevents runaway costs better than metered.