Bring Your Own Key (BYOK)

Save provider keys for supported BYOK requests. Keys are encrypted at rest; we only display the last 4 characters.

Use a compatible saved key automatically for normal text chats. Models without a matching key use NanoGPT billing. If a key fails, the request stops. You can override this in each chat’s Billing Mode. Your provider bills you directly; NanoGPT’s 5% BYOK markup still applies.

Prefer BYOK for API requests

Off

Compatible saved provider keys take priority over normal provider routing. NanoGPT tries your first compatible saved key before shared capacity; if no matching key exists or the BYOK attempt fails with a retryable error, it continues through normal credit-based routing and billing. Send x-use-byok: false or byok.enabled: false to opt out for one request.

OpenAI icon
OpenAI
Not configured

NanoGPT records your declaration and may consider it for text ZDR routing. NanoGPT does not verify your provider agreement, and this declaration does not itself guarantee provider behavior. It never applies to video generation.

OpenAI Responses icon
OpenAI Responses
Not configured

NanoGPT records your declaration and may consider it for text ZDR routing. NanoGPT does not verify your provider agreement, and this declaration does not itself guarantee provider behavior. It never applies to video generation.

Anthropic icon
Anthropic
Not configured

NanoGPT records your declaration and may consider it for text ZDR routing. NanoGPT does not verify your provider agreement, and this declaration does not itself guarantee provider behavior. It never applies to video generation.

Chutes icon
Chutes
Not configured

NanoGPT records your declaration and may consider it for text ZDR routing. NanoGPT does not verify your provider agreement, and this declaration does not itself guarantee provider behavior. It never applies to video generation.

AWS Bedrock icon
AWS Bedrock
Not configured

NanoGPT records your declaration and may consider it for text ZDR routing. NanoGPT does not verify your provider agreement, and this declaration does not itself guarantee provider behavior. It never applies to video generation.

Paste JSON: {"accessKeyId":"...","secretAccessKey":"...","region":"us-east-1"}

Groq icon
Groq
Not configured

NanoGPT records your declaration and may consider it for text ZDR routing. NanoGPT does not verify your provider agreement, and this declaration does not itself guarantee provider behavior. It never applies to video generation.

Sakana AI icon
Sakana AI
Not configured

NanoGPT records your declaration and may consider it for text ZDR routing. NanoGPT does not verify your provider agreement, and this declaration does not itself guarantee provider behavior. It never applies to video generation.

SambaNova
Not configured

NanoGPT records your declaration and may consider it for text ZDR routing. NanoGPT does not verify your provider agreement, and this declaration does not itself guarantee provider behavior. It never applies to video generation.

Novita icon
Novita
Not configured

NanoGPT records your declaration and may consider it for text ZDR routing. NanoGPT does not verify your provider agreement, and this declaration does not itself guarantee provider behavior. It never applies to video generation.

MegaNova icon
MegaNova
Not configured

NanoGPT records your declaration and may consider it for text ZDR routing. NanoGPT does not verify your provider agreement, and this declaration does not itself guarantee provider behavior. It never applies to video generation.

Xiaomi icon
Xiaomi
Not configured

NanoGPT records your declaration and may consider it for text ZDR routing. NanoGPT does not verify your provider agreement, and this declaration does not itself guarantee provider behavior. It never applies to video generation.

SiliconFlow icon
SiliconFlow
Not configured

NanoGPT records your declaration and may consider it for text ZDR routing. NanoGPT does not verify your provider agreement, and this declaration does not itself guarantee provider behavior. It never applies to video generation.

Custom Inference
Not configured

NanoGPT records your declaration and may consider it for text ZDR routing. NanoGPT does not verify your provider agreement, and this declaration does not itself guarantee provider behavior. It never applies to video generation.

Akash icon
Akash
Not configured

NanoGPT records your declaration and may consider it for text ZDR routing. NanoGPT does not verify your provider agreement, and this declaration does not itself guarantee provider behavior. It never applies to video generation.

Google AI Studio icon
Google AI Studio
Not configured

NanoGPT records your declaration and may consider it for text ZDR routing. NanoGPT does not verify your provider agreement, and this declaration does not itself guarantee provider behavior. It never applies to video generation.

Google Vertex icon
Google Vertex
Not configured

NanoGPT records your declaration and may consider it for text ZDR routing. NanoGPT does not verify your provider agreement, and this declaration does not itself guarantee provider behavior. It never applies to video generation.

Paste a Google service account JSON key with location or region.

Z.AI (GLM) icon
Z.AI (GLM)
Under maintenance

NanoGPT records your declaration and may consider it for text ZDR routing. NanoGPT does not verify your provider agreement, and this declaration does not itself guarantee provider behavior. It never applies to video generation.

Gerra icon
Gerra
Not configured

NanoGPT records your declaration and may consider it for text ZDR routing. NanoGPT does not verify your provider agreement, and this declaration does not itself guarantee provider behavior. It never applies to video generation.

Mixlayer icon
Mixlayer
Not configured

NanoGPT records your declaration and may consider it for text ZDR routing. NanoGPT does not verify your provider agreement, and this declaration does not itself guarantee provider behavior. It never applies to video generation.

CrofAI icon
CrofAI
Not configured

NanoGPT records your declaration and may consider it for text ZDR routing. NanoGPT does not verify your provider agreement, and this declaration does not itself guarantee provider behavior. It never applies to video generation.

GMICloud icon
GMICloud
Not configured

NanoGPT records your declaration and may consider it for text ZDR routing. NanoGPT does not verify your provider agreement, and this declaration does not itself guarantee provider behavior. It never applies to video generation.

Cerebras icon
Cerebras
Not configured

NanoGPT records your declaration and may consider it for text ZDR routing. NanoGPT does not verify your provider agreement, and this declaration does not itself guarantee provider behavior. It never applies to video generation.

DeepInfra icon
DeepInfra
Not configured

NanoGPT records your declaration and may consider it for text ZDR routing. NanoGPT does not verify your provider agreement, and this declaration does not itself guarantee provider behavior. It never applies to video generation.

Hyperbolic icon
Hyperbolic
Disabled
Fireworks icon
Fireworks
Disabled
Together icon
Together
Disabled
Tavily icon
Tavily (Web Search)
Not configured

For web search only. Used by /api/web and web-search enhancements.

Exa icon
Exa (Web Search)
Not configured

For web search only. Supports neural/semantic search modes.

Kagi icon
Kagi (Web Search)
Not configured

For web search only. Used by /api/web and web-search enhancements.

Perplexity icon
Perplexity (Web Search)
Not configured

For web search only. Used by /api/web and web-search enhancements.

Valyu (Web Search)
Not configured

For web search only. Supports web, news, and proprietary indexes.

Replace YOUR_NANOGPT_API_KEY and choose one of your saved model provider keys: openai | openai-responses | anthropic | chutes | aws | groq | sakana | sambanova | novita | meganova | xiaomi | siliconflow | wafer | akash | google | google-vertex | zai | gerra | mixlayer | crofai | gmicloud | cerebras | deepinfra. Web search keys are used only for web search endpoints and enhancements.

curl -X POST https://nano-gpt.com/api/v1/chat/completions \
  -H "x-api-key: YOUR_NANOGPT_API_KEY" \
  -H "x-use-byok: true" \
  -H "x-byok-fallback-to-credits: true" \
  # Optional but recommended: force provider mapping when in doubt \
  -H "x-byok-provider: openai" \
  -H "content-type: application/json" \
  -d '{
    "model": "gpt-4o-mini",
    "messages": [
      {"role": "user", "content": "Say hello from BYOK"}
    ]
  }'

What is the pricing?

We charge a 5% markup on the normal at-cost API rates. Your provider bills you directly; we only charge the markup.

What if I use a free model via BYOK?

If the model that you use is free via the original provider where you use it from we base our 5% markup on what the lowest rate would be if you used the paid version of it. If you for example use an API key that has free requests for gemini-2.5-pro, we will charge the 5% markup based on regular gemini-2.5-pro pricing.

Which endpoint supports BYOK?

BYOK is supported on the OpenAI-compatible endpoint /api/v1/chat/completions. Web chat can use saved provider keys for normal text chat when saved-key mode is enabled; the standard provider selector remains platform-billed.

Where are web search keys used?

Web search keys are used for web search only (e.g., /api/web and web-search enhancements). They are not chat model providers.

Do I have to set x-byok-provider?

No. It’s optional. We auto-map based on the model. Setting it is recommended if you want to force a specific provider.

How do I use Google Gemini AI Studio?

Add your Google AI Studio provider key above, then set the header x-byok-provider: google when calling /api/v1/chat/completions. This forces BYOK routing through Google AI Studio for Gemini models.

How do I use Google Vertex?

Add your Google Vertex service account JSON above with a location. It can be selected for Gemini text models and supported Claude models in saved-key web chat, or forced on the API with x-byok-provider: google-vertex. Prefer BYOK also tries it when the model’s normal saved-provider credential is unavailable. Claude uses the native Anthropic publisher API; enable the model in Vertex Model Garden and choose a location where it is available.

What usage counts are used for billing?

We prefer provider-reported usage tokens when available (streaming or final usage). If unavailable, we estimate conservatively.

How are keys stored?

Saved provider keys are encrypted at rest. We only store the last 4 characters for display and never send keys back to the client.