Quickstart
Get started with FirstRouter API in just a few steps
Getting Started
FirstRouter provides a unified API that gives you access to numerous AI models through a single endpoint, while automatically handling fallbacks and selecting the most cost-effective options.
1. Get Your API Key
First, you'll need to generate an API key from your dashboard:
- Navigate to your Dashboard → API Keys
- Click "Create API Key"
- Copy your API key and store it securely
Important: Keep your API key secure and never expose it in client-side code.
2. Make Your First Request
You can start making requests to our API endpoint using any HTTP client. Here's a simple example:
curl -X POST "https://api.firstrouter.ai/v1/chat/completions" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-4o-mini",
"messages": [
{
"role": "user",
"content": "Hello, how are you?"
}
]
}'
3. Available Endpoints
FirstRouter offers several endpoints to interact with AI models and manage your account:
Chat Completions
Generate chat completions with various AI models
POST /v1/chat/completions
List Models
Get a list of all available AI models
GET /v1/models
Get Model Details
Get detailed information about a specific model
GET /v1/models/:model-id
Check Balance
Check your current credit balance
GET /v1/balance
4. Next Steps
Now that you're set up, explore our comprehensive API documentation: