Authentication

All requests to the Arvae AI API require authentication using an API key. This guide explains how to obtain, use, and manage your API keys securely.

API Keys

API keys are unique identifiers that authenticate your requests to the Arvae API. Every request must include your API key in the Authorization header.

Security Warning

Your API keys provide full access to your Arvae AI account. Never share your API keys publicly or include them in client-side code. Always store them securely.

Getting an API Key

You can create API keys from your Arvae AI dashboard. Each key can have specific permissions and usage limits.

To create a new API key:

  1. Log in to your Arvae AI Dashboard
  2. Navigate to API Keys section
  3. Click Create New API Key
  4. Name your key (e.g., "Development", "Production")
  5. Copy and securely store your new API key

Important: Your API key will only be shown once when created. Make sure to copy it and store it securely.

Free Credits for New Users

When you first sign up, your account receives free credits to test the API. You can see your current credit balance in your dashboard.

View your credits →

Using Your API Key

To authenticate your API requests, include your API key in the Authorization header using the Bearer token scheme.

Authentication Header
1Authorization: Bearer YOUR_API_KEY

Example Request with Authentication

cURL Example
1curl https://arvae.ai/api/v1/chat/completions \
2  -H "Content-Type: application/json" \
3  -H "Authorization: Bearer YOUR_API_KEY" \
4  -d '{
5    "model": "openai/chatgpt-4o-latest",
6    "messages": [
7      {
8        "role": "user",
9        "content": "Hello, who are you?"
10      }
11    ],
12    "temperature": 0.7,
13    "max_tokens": 1024
14  }'

API Key Management

Key Rotation

Regularly rotating your API keys is a security best practice. Create a new key, update your applications, then delete the old key.

Revoking Keys

If you suspect a key has been compromised, immediately revoke it from your dashboard. This will prevent any further usage of the key.

Best Practices

  • Use Environment Variables: Store API keys in environment variables, not in your code.
  • Different Keys for Different Environments: Use separate keys for development, staging, and production.
  • Regular Rotation: Rotate keys periodically, especially for production environments.
  • Monitor Usage: Regularly check your API key usage for unusual patterns.

Usage Tracking

You can monitor your API usage and associated costs in the Arvae AI dashboard. This helps you keep track of your consumption and manage your billing.

Usage Dashboard

The usage dashboard shows:

  • Total API calls by date and model
  • Token usage (input and output)
  • Associated costs, including your 15% discount
  • Usage patterns and trends
View usage dashboard →

Authentication Errors

If your authentication fails, you'll receive one of these error responses:

401Missing API Key
1{
2  "error": {
3    "message": "No API key provided",
4    "type": "auth_error",
5    "param": null,
6    "code": "missing_api_key"
7  }
8}
401Invalid API Key
1{
2  "error": {
3    "message": "Invalid API key provided",
4    "type": "auth_error",
5    "param": null,
6    "code": "invalid_api_key"
7  }
8}

Next Steps

Now that you understand authentication, explore the available models and start making API requests.