LLM API

API Keys

Create, manage API keys, and configure routing strategies for Consumers

Create a Consumer API Key

  1. 01Log in → Console → LLM → My API Keys
  2. 02Click Create New Key. . Set a descriptive name (e.g. "dev-key", "production-api")
  3. 03Keys are in the format sk-xxxxxxxxxxxx.. Copy and store the key safely — you can only view it by clicking "Reveal"

Key Limits

Authentication

Use the API key in the header Authorization with the format Bearer:

# Authorization header
Authorization: Bearer sk-your-api-key
# Ví dụ curl
curl -X POST https://api.arzastore.com/v1/chat/completions  -H "Authorization: Bearer sk-your-api-key"  -H "Content-Type: application/json"  -d '{"model": "gpt-4o", "messages": [{"role": "user", "content": "Hello"}]}'
# Python - OpenAI SDK tự động thêm header
from openai import OpenAI
client = OpenAI(
 api_key="sk-your-api-key", # ← Bearer token
 base_url="https://api.arzastore.com/v1" # ← Endpoint URL từ Marketplace
)

Routing Strategies

Each API key has a routing strategy that determines how the system selects a provider when you subscribe to multiple models/providers of the same type (e.g. 3 providers all offering GPT-4o).

Distributes requests evenly across subscribed providers. Each request is sent to the next provider in a circular order.

Always sends to the highest-priority provider. If that provider fails (timeout, 5xx), automatically switches to the next provider in the list.

Always selects the provider with the lowest price for the requested model. Suitable when you want to minimize costs.

Change Strategy

Model Subscriptions & Aliases

Each API key needs to subscribe to at least 1 model to function. You can subscribe to multiple models from different providers.

Aliases — Group Multiple Providers

Aliases let you group multiple subscriptions of the same model type under a single name. When you call the API with the alias name, the system applies the routing strategy to select a provider.

Example:

You subscribe to 3 GPT-4o models from 3 different providers and set the alias for all 3 to "gpt-4o"

→ When calling the API with model: "gpt-4o", the system will automatically round-robin/fallback/cheapest among the 3 providers.

Secure Your API Key

Don't commit keys to git

Store keys in environment variables or a .env.Add .env to .gitignore.

Don't expose keys on the client side

Always call the API from a backend/server. Never put API keys in frontend JavaScript.

Rotate keys periodically

Create new keys and delete old ones periodically. If you suspect a key is compromised, delete it immediately and create a new one.

# Pakai variabel environment
# File .env
ARZASTORE_API_KEY=sk-xxxxxxxxxxxx
ARZASTORE_BASE_URL=https://api.arzastore.com/v1
# Python
import os
from openai import OpenAI
client = OpenAI(
 api_key=os.environ["ARZASTORE_API_KEY"],
 base_url=os.environ["ARZASTORE_BASE_URL"]
)

Handle Common Errors

HTTP StatusCauseFix
401Invalid or deleted API keyCheck the key, create a new one if needed
402Insufficient account balanceTop up your wallet
403No access to the modelSubscribe to the model in the key drawer
429Rate limit exceededReduce request frequency, try retry with backoff
500/502/503Provider-side errorUse fallback strategy or try another provider

Tips for Effective API Key Usage

  • -Create separate keys for each application/environment (dev, staging, prod)
  • -Use aliases to group multiple providers → automatic failover when one provider fails
  • -Choose fallback for production (prioritize stability) and cheapest for development (save costs)
  • -Test your key in the drawer → "Test" tab before using in code

Need more help?

Our support team is ready to assist you

$

Prices are shown in USD

Picked from your location (Chile). You can change it anytime from the language button in the top bar, or pick one below.