Skip to main content

Overview

This guide walks through creating an LLM Key and configuring an OpenAI-compatible SDK to call Aptible’s LLM Gateway instead of OpenAI directly, so every request is authenticated, audited, and covered by your organization’s Model Access Policy and Spend Limit.

Create an LLM Key

1

Start your trial or sign in

Sign up for or sign in to your Aptible account. Then navigate to LLM Gateway to activate your trial. You’ll receive $10 of LLM credits to get you started, which can be used with any models your organization allows.
For those processing PHI: you’ll need to execute a BAA before you can start processing PHI using the LLM Gateway. Go to Settings > Agreements to execute one.
2

Create an LLM key

Click Create Key on the LLM Gateway page and give it a descriptive name so you can identify its usage later when reviewing costs and request history.LLM Keys are scoped to your whole organization — any member can create and manage them, and a single key gives you access to every model your organization’s model access policy allows.Once created, copy the key’s token and endpoint URL. You won’t be able to see the token again after you close this window.
If a key’s token is ever lost or compromised, revoke it from LLM Gateway and create a new one — see LLM Keys for details.

Configure your SDK

Point your SDK’s base URL at the LLM Gateway’s OpenAI-compatible endpoint, https://llm-gateway.aptible.com/openai, and use your LLM Key as the API key. See Supported APIs for the full list of OpenAI-compatible endpoints.
Replace "gpt-5" with any model ID from Supported Models that your organization’s Model Access Policy allows.
Environment variables also work, if your SDK or framework reads them: set OPENAI_API_KEY to your LLM Key and OPENAI_BASE_URL to https://llm-gateway.aptible.com/openai/v1.

Verify it’s working

Run the snippet above. If you get a response back, requests are flowing through the LLM Gateway. You can confirm this by checking the key’s request history in LLM Gateway to confirm, or see Audit Logging for more ways to review your request.

Troubleshooting

Double-check your API key is set to a valid, unrevoked LLM Key, and that the base URL points at https://llm-gateway.aptible.com/openai/v1 (or https://llm-gateway.aptible.com/openai, depending on whether your SDK appends /v1 itself).
Check that the model you’re requesting is a valid model ID from Supported Models, and that it’s allowed by your organization’s Model Access Policy.
Your organization has reached its monthly spend limit. See Cost Visibility & Control.