Updated
Open Source LLM API Key: Get One and Use It

The key for a hosted open-weight model is a bearer token. You get one after sign-up, then use it in any OpenAI-compatible client by changing the base URL.
What this key is, and what it is not
An open source llm api key is the credential that lets your code call a model whose weights are published openly, but which someone else runs on their own hardware for you. You do not download anything or manage a GPU. You send HTTPS requests, and the key tells the service whose prepaid balance to charge.
It helps to rule out two mix-ups. First, it is not a Hugging Face token. A Hugging Face token lets you download model files; this key lets you send prompts to a running model. Second, it is not a key to the official API of a model vendor. The model here is one open-weight model from an independent provider, tuned to answer without content refusals for lawful adult use, and the service does not route to other vendors.
The key works as a bearer token. Every request carries the header Authorization: Bearer YOUR_KEY, and that is the entire authentication scheme.
Get a key in four steps
- Sign up. Use Google, or an email address and password.
- Open the API key page. The key page shows your key after you are signed in.
- Claim the trial. A single click gives $0.50 of trial credit, valid for 7 days, one per person, no card required.
- Copy the key into a password manager or a secrets store, not into a chat message or a document.
When the trial runs out, top up with any whole amount from $20 to $500. Bonuses apply: +5% from $50, +10% from $100, +15% from $200. You can pay by card (Visa, Mastercard, Apple Pay, Google Pay) or crypto (USDT on TRC20, USDC on Base). The rates are $0.15 per 1M input tokens and $0.50 per 1M output tokens. See the pricing page for the full table.
Your first request with curl
Before you touch an SDK, prove the key works from a terminal. This also shows you the response headers you will want later.
export LLM_API_KEY="paste-your-key-here"
curl -i https://api.opensourcellmapi.com/v1/chat/completions \
-H "Authorization: Bearer $LLM_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "Say hello in five words."}]
}'
The -i flag prints headers. Look for X-Request-Id, X-Balance-USD, X-RateLimit-Limit-Requests and X-RateLimit-Limit-Concurrency. The balance header is useful: it tells you what is left on your account after each call.
To check which models your key can see, call GET /v1/models with the same header. It returns the model ID you will use in every request.
Use the key from Python and Node
Any OpenAI SDK works. You change two settings: the base URL and the key.
Python
import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.opensourcellmapi.com/v1",
api_key=os.environ["LLM_API_KEY"],
)
resp = client.chat.completions.create(
model="uncensored",
messages=[{"role": "user", "content": "Explain what a context window is."}],
)
print(resp.choices[0].message.content)
Node
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.opensourcellmapi.com/v1",
apiKey: process.env.LLM_API_KEY,
});
const resp = await client.chat.completions.create({
model: "uncensored",
messages: [{ role: "user", content: "Explain what a context window is." }],
});
console.log(resp.choices[0].message.content);
Both SDKs can also read their settings from environment variables, which is handy for tools you do not write yourself. The official OpenAI SDKs read OPENAI_API_KEY and OPENAI_BASE_URL, so setting those two is often enough to redirect an existing script. The quickstart in the docs adds streaming and tool-calling examples.
Entering the key in other tools
Most chat front ends, editors and agent frameworks that mention "OpenAI-compatible" have the same three fields. Look for a custom provider or custom endpoint setting.
- Base URL / API URL:
https://api.opensourcellmapi.com/v1 - API key: your key
- Model:
uncensored(type it by hand if the tool cannot fetch the list)
If a tool asks for the complete endpoint, use https://api.opensourcellmapi.com/v1/chat/completions. If it insists on a vendor-specific key format, it probably is not compatible with a custom endpoint, and you should check its documentation.
A common mistake is leaving the old provider's model name in place. The model field must read uncensored; a name from another service will not match.
Keep the key safe
A key is a spending credential. Whoever holds it can use your prepaid balance. A few habits prevent most leaks.
- Put it in an environment variable or a secrets manager. Do not commit it to Git, even in a private repository.
- Call the API from your server. Anything in browser JavaScript or a mobile app bundle can be read by users, and your key goes with it.
- Use separate keys or separate environments for development and production where you can, so a test script cannot drain the production balance.
- Watch
X-Balance-USDin responses. A balance that drops faster than your traffic suggests is the earliest sign of misuse. - If you think the key has leaked, contact support right away and stop using it in the meantime.
Prompts are not used for training, but they still travel over the network to a hosted service. Do not send secrets, passwords or personal data you would not want a provider to process.
Limits and what 429 means
Each key has limits, and they differ by key type.
| Key | Concurrent requests | Requests per minute |
|---|---|---|
| Trial | 2 | 60 |
| Full (after top-up) | 8 | 300 |
Past either limit you get HTTP 429. The error code rate_limited means too many requests per minute. The code concurrency means too many at once. A streamed request holds its slot until the stream ends, so a slow consumer can keep slots occupied. A 429 with a Retry-After: 5 header signals temporary overload; wait five seconds and retry.
import time
from openai import OpenAI, RateLimitError
client = OpenAI(base_url="https://api.opensourcellmapi.com/v1", api_key="YOUR_KEY")
def ask(prompt, tries=4):
for attempt in range(tries):
try:
r = client.chat.completions.create(
model="uncensored",
messages=[{"role": "user", "content": prompt}],
)
return r.choices[0].message.content
except RateLimitError as e:
wait = int(e.response.headers.get("Retry-After", 2 * (attempt + 1)))
time.sleep(wait)
raise RuntimeError("still rate limited")
The body size limit is 8 MB, and the context window is 100,000 tokens including the reply. Failed or refused requests are not charged.
Setting the key in common environments
How you store the key depends on where the code runs. The goal is the same each time: it lives outside your source files.
- Local shell. Add
export LLM_API_KEY=...to a file that is not in your repository, or load it from a password manager command. - A .env file. Fine for development, as long as
.envis listed in.gitignorebefore your first commit. Libraries such as python-dotenv or dotenv for Node read it at startup. - Docker. Pass it at run time with
-e LLM_API_KEYor a secrets mechanism; do not bake it into the image withENVorCOPY, since image layers can be inspected. - CI and hosting platforms. Use the platform's encrypted secrets and expose them only to the jobs that need them.
Logging deserves its own warning. Many HTTP debuggers print request headers, and the key sits in one. Mask the header before you paste a log into an issue tracker or a chat.
If your key does not work
Most failed first requests come from a short list of causes. Go through them in order.
- Extra characters. A trailing space or newline copied with the key will break authentication. Paste it into a plain text field first and check.
- Wrong base URL. The path must end in
/v1. The OpenAI SDKs add/chat/completionsthemselves; adding it twice gives a 404. - Wrong model name. The only model ID is
uncensored. Names from other services will not match. - Empty balance. After the 7-day trial ends or the $0.50 is spent, you need a top-up of at least $20.
- Limit hit. A trial key allows 2 concurrent requests, so a script firing 10 in parallel gets 429s. Lower the concurrency or top up for a full key.
If none of these apply, send the value of X-Request-Id from the failing response to support, so the request can be found.
What the model can and cannot do
The key gives access to text generation, and only that: chat completions with streaming, tool calling, JSON mode, and the usual sampling parameters. There is no image, audio or video generation, no embeddings and no fine-tuning. The one hard content limit is that no sexual content involving minors is allowed.
If you only need a quick sense of cost, remember that a call with 2,000 input tokens and 500 output tokens costs $0.0003 plus $0.00025, or $0.00055. The $0.50 trial therefore covers roughly 900 calls of that size.
More guides
Questions and answers
Is the key itself free?
Not permanently. New users can claim a $0.50 trial credit once, valid for 7 days. After that you pay per token from prepaid credit, starting with a $20 top-up.
Do I need a card to get a key?
No card is needed for the trial. A card or crypto is needed only when you top up.
Can I use the key with the OpenAI SDK?
Yes. Set the base URL to https://api.opensourcellmapi.com/v1, pass your key, and use the model ID uncensored.
Is this the same as a Hugging Face token?
No. A Hugging Face token downloads model files; this key sends prompts to a hosted model and bills your prepaid balance.
Your key is one form away
Create an account, copy the key, change the base URL. That is the whole setup.
Get API key