freeaiapi.ai

Authentication

How to send your API key with each request.

Create keys in the console under API Keys. You can create several keys, give each a spending limit, restrict it to certain models, and disable it at any time.

OpenAI format

Send the key as a bearer token:

Authorization: Bearer YOUR_FREEAIAPI_KEY

Anthropic format

Requests to /v1/messages also accept the Anthropic-style header:

x-api-key: YOUR_FREEAIAPI_KEY

Gemini format

Gemini-native paths (/v1beta/models/...) accept the key as a key query parameter or an x-goog-api-key header.

Keep keys server-side. Never ship an API key in browser or mobile app code. If a key leaks, disable it in the console and create a new one.

On this page