Skip to main content
API key guide Direct provider checked 2026-10-27

OpenAI API key setup

OpenAI's developer API for browser-direct BYOK Chat. Use an API key from the OpenAI platform; ChatGPT login is not part of this connection flow.

Endpoint
api.openai.com/v1
API shape
OpenAI-compatible
Free tier
No usage billed
Paid plans
None listed metered billing

01Get your key

  1. Open the OpenAI API keys page: platform.openai.com/api-keys
  2. Create an account and generate an API key.
  3. Paste it into the Dracon BYOK provider keys, stored encrypted (AES-256-GCM), used browser-direct, works in every Dracon tool.

02Get the key and test it

  1. Open the OpenAI API keys page: platform.openai.com/api-keys Create a key and copy the secret straight away.
  2. Point your client at this provider's base URL: https://api.openai.com/v1 It speaks the OpenAI-compatible shape, so an OpenAI SDK client works against it with no adapter: only the base URL and the key change.
  3. Prove the endpoint answers before you trust it. Send one call with no Authorization header: a live endpoint answers 401 Unauthorized, because it is waiting for a bearer key. The wording of that error differs by provider (some say invalid_api_key, others incorrect_api_key or Token is invalid), so read the 401 as the signal, not the error text.
  4. Paste the key into the Dracon BYOK provider keys ; stored encrypted, used browser-direct, no relay.
  5. Compare other provider plans when this subscription does not match your usage or budget.

Test the key

Both examples read the key from the OPENAI_API_KEY environment variable, so the key stays out of the command line.

curl
export OPENAI_API_KEY="<YOUR_API_KEY>"

curl https://api.openai.com/v1/chat/completions \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"gpt-4.1","messages":[{"role":"user","content":"hi"}]}'
python
import os
from openai import OpenAI

# export OPENAI_API_KEY="<YOUR_API_KEY>" first
client = OpenAI(
    api_key=os.environ["OPENAI_API_KEY"],
    base_url="https://api.openai.com/v1",
)
resp = client.chat.completions.create(
    model="gpt-4.1",
    messages=[{"role": "user", "content": "hi"}],
)
print(resp.choices[0].message.content)

03Free tier

No recurring free tier advertised as of the last check(2026-10-27). Usage is billed per the provider's listed pricing. You pay them directly, no Dracon markup.

If a free tier matters, compare the providers that have one on AI Hub Free; the paid tiers for this provider are compared below where the catalog lists them.

04Connection details

Base URL
https://api.openai.com/v1
API shape
OpenAI-compatible
Env var
OPENAI_API_KEY
Models

05Gotchas

API key only. ChatGPT login, cookies, and ChatGPT sessions are not supported here.

06Questions readers actually ask

Where do I get a OpenAI API key?

OpenAI documents key management at https://platform.openai.com/api-keys. Step 01 links there directly.

What endpoint does the key call?

Our captured OpenAI-compatible base URL is https://api.openai.com/v1. The test call appends /chat/completions.

Does OpenAI have a free tier?

Our capture does not show a recurring free tier for OpenAI. Check the provider's current pricing before relying on one.

Use your key in every tab

Two free extensions take the key you just set up. Both read the page you are on and use your own provider key: free, no account, nothing stored on a server we run.

SamAI

Summarize or ask about any page with your own provider key.

Add to Chrome Add to Firefox

AI Auto Form Filler

Complete a web form from a short description, using a model you bring yourself.

Add to Chrome Add to Firefox

All extensions · last checked 2026-10-22.

Add your OpenAI API key Add this provider to a fallback list Compare provider plans Dracon Omni · one price for everything we make