Skip to main content
Every request you send to the NexLLM API must include your API key for authentication. For standard OpenAI-compatible requests, you pass the key as a Bearer token in the Authorization header. NexLLM also supports native provider authentication formats for Claude and Gemini, which use different header conventions.

Standard Authentication

Include your API key in the Authorization header as a Bearer token on every request:

Example: curl

Example: OpenAI SDK (Python)

Configure the OpenAI client with your NexLLM API key and base URL — all subsequent calls are authenticated automatically:

Native Provider Authentication

If you prefer to use provider-native request formats, NexLLM supports their authentication conventions as well.

Claude Native Format

Instead of the Authorization header, pass your key in the x-api-key header. You must also include the anthropic-version header:

Gemini Native Format

Pass your API key as a key query parameter on the Gemini-format endpoint:

Security Best Practices

Keep your API key secret at all times. Never hard-code it in client-side code, commit it to source control, or share it publicly. If a key is compromised, rotate it immediately from the NexLLM dashboard.
Use environment variables to manage your key in application code:
Don’t have an API key yet? Visit the Getting Your API Keys guide to create one from the NexLLM dashboard.