AgentRouter Pro

Getting Started

Get started with AgentRouter in 5 minutes

Getting Started

This guide will help you get up and running with AgentRouter in 5 minutes.

Step 1: Register an Account

  1. Visit the AgentRouter website
  2. Click the "Sign Up" button
  3. Register with email or GitHub/Google account
  4. After registration, you'll automatically receive a $1 welcome bonus

Step 2: Create an API Key

  1. After logging in, go to the API Keys Management page
  2. Click the "Create API Key" button
  3. Set a key name (optional)
  4. Configure rate limits (optional):
    • Request limit - Maximum requests per time window
    • Reset interval - How often to reset the counter (seconds)
  5. Click "Create"
  6. Important: Copy and save your API key - it will only be shown once!

API key format: sk-ar-xxxxxxxxxxxxxxxx

Step 3: Make Your First Request

Using Python (OpenAI SDK)

from openai import OpenAI

# Initialize client
client = OpenAI(
    api_key="sk-ar-your-api-key",  # Replace with your API key
    base_url="https://your-agentrouter.com/v1"  # Replace with your AgentRouter URL
)

# Call GPT-4
response = client.chat.completions.create(
    model="gpt-4o",
    messages=[
        {"role": "user", "content": "Hello!"}
    ]
)

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

Using Node.js (OpenAI SDK)

import OpenAI from 'openai';

// Initialize client
const client = new OpenAI({
  apiKey: 'sk-ar-your-api-key',  // Replace with your API key
  baseURL: 'https://your-agentrouter.com/v1'  // Replace with your AgentRouter URL
});

// Call GPT-4
const response = await client.chat.completions.create({
  model: 'gpt-4o',
  messages: [
    { role: 'user', content: 'Hello!' }
  ]
});

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

Using curl

curl https://your-agentrouter.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk-ar-your-api-key" \
  -d '{
    "model": "gpt-4o",
    "messages": [
      {"role": "user", "content": "Hello!"}
    ]
  }'

Step 4: Try Other Models

Just change the model parameter to access different providers:

# DeepSeek
response = client.chat.completions.create(
    model="deepseek-chat",
    messages=[{"role": "user", "content": "Hello!"}]
)

# Moonshot
response = client.chat.completions.create(
    model="moonshot-v1-8k",
    messages=[{"role": "user", "content": "Hello!"}]
)

Using Anthropic Format

from anthropic import Anthropic

# Initialize client
client = Anthropic(
    api_key="sk-ar-your-api-key",
    base_url="https://your-agentrouter.com"
)

# Call Claude
response = client.messages.create(
    model="claude-3-5-sonnet-20241022",
    max_tokens=1024,
    messages=[
        {"role": "user", "content": "Hello!"}
    ]
)

print(response.content[0].text)

Check Your Balance

Each request deducts the corresponding cost from your wallet. You can:

  1. Visit the Wallet page to check your balance
  2. View detailed transaction history
  3. Learn about billing rates for each model

FAQ

What prefix do API keys use?

All AgentRouter API keys start with sk-ar-.

How do I top up?

Currently, you need to contact the administrator for top-ups. Self-service wallet features are in development.

Which models are supported?

See Supported Models for the complete list.

How do I handle errors?

See Troubleshooting for common errors and solutions.

Next Steps

On this page