Authentication
How to authenticate requests to the RouteMarket API.
RouteMarket uses API keys for public gateway requests.
Base URL
Use the production gateway URL:
https://api.routemarket.aiIf you are using an OpenAI-compatible SDK, the base URL is typically:
https://api.routemarket.ai/v1Authorization header
Send your key in the Authorization header:
Authorization: Bearer <your_api_key>curl example
curl https://api.routemarket.ai/v1/models \
-H "Authorization: Bearer $ROUTELAB_API_KEY"OpenAI SDK example
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.ROUTELAB_API_KEY,
baseURL: "https://api.routemarket.ai/v1"
});What the key controls
A RouteMarket API key is not only a credential. It can also affect runtime behavior through project and key-level policy, including:
- model access
- route visibility
- routing preference
- usage limits
- budget or rate constraints
That means two keys may not see the same model list or route behavior.
Common auth failures
Typical authentication-related failures include:
PROJECT_KEY_INVALIDPROJECT_KEY_DISABLEDPROJECT_LIMIT_EXCEEDEDINSUFFICIENT_BALANCE
See Errors for the first-pass error guide.