๐Ÿธ KeyFrog API

AI infrastructure for production applications.

KeyFrog is a unified API gateway that provides developers and businesses with access to 58+ AI models from 14+ providers through a single, OpenAI-compatible endpoint. No vendor lock-in. One API key for everything.

๐Ÿ”—
OpenAI Compatible
Drop-in replacement. Use existing OpenAI SDKs with zero changes.
๐Ÿ”‘
One API Key
Access all 58+ models with a single key. No per-provider setup.
๐Ÿ’ฐ
Pay as You Go
Only pay for tokens you use. No subscriptions, no minimums.
๐Ÿข
Enterprise Ready
High availability, automatic failover, and SLA support.

Quick Start

Make your first API call in under 5 minutes.

Create API Key

Sign up at Dashboard and generate your API key.

Copy Base URL

Use https://api.keyfrog.top/v1 as your API endpoint.

Send Your First Request

Make a chat completion call. See the code example โ†’

๐Ÿ’ก Tip: Start with gpt-4o-mini or deepseek-v4-flash โ€” they're fast and cheap, perfect for testing.

Authentication

Authenticate all requests with a Bearer token.

Include your API key in the Authorization header of every request:

Authorization: Bearer kf-your-api-key

Best practices

  • Never expose keys in client-side code. Use environment variables or a backend proxy.
  • Rotate keys periodically. Generate new keys from the Dashboard.
  • Use separate keys for development and production environments.
โš ๏ธ Security: If you suspect a key is compromised, revoke it immediately from the Dashboard.

Base URL

All API requests use a single endpoint.

https://api.keyfrog.top/v1

All endpoints are fully compatible with the OpenAI API specification. You can use any OpenAI SDK or HTTP client by simply changing the base URL.

Available endpoints

EndpointMethodDescription
/v1/chat/completionsPOSTCreate chat completions
/v1/modelsGETList all available models

Chat Completion

POST/v1/chat/completions

Create a model response for a conversation. Compatible with OpenAI's Chat Completions API.

Request body

ParameterTypeDescription
model REQUIREDstringModel ID (e.g., gpt-4o-mini, deepseek-v4-pro)
messages REQUIREDarrayArray of message objects with role and content
temperature OPTIONALnumberSampling temperature (0โ€“2). Default: 1
max_tokens OPTIONALintegerMaximum tokens in the response
stream OPTIONALbooleanEnable SSE streaming. Default: false

Message roles

  • system โ€” Sets the assistant's behavior and instructions
  • user โ€” The user's input message
  • assistant โ€” Previous assistant responses (for multi-turn conversations)

Streaming

POST/v1/chat/completions

Get real-time token-by-token responses via Server-Sent Events (SSE).

Set "stream": true in your request. The server sends data: chunks. The stream ends with data: [DONE].

How it works

  1. Set "stream": true in the request body
  2. The server responds with text/event-stream content type
  3. Each chunk contains a delta field with incremental content
  4. The stream ends with data: [DONE]
๐Ÿ’ก Tip: Streaming dramatically improves perceived latency. Recommended for all interactive applications.

Models

GET/v1/models

List all available models. Currently serving 58+ models from 14+ providers.

Models are loaded dynamically from our backend. Use the id field in your chat completion requests.

Available Models

Loading models from backend...

Pricing

Pay-as-you-go. No subscriptions. No hidden fees.

All prices are in USD per 1 million tokens. Pricing data is synced from our backend in real time.

๐Ÿ’ฐ Formula: Cost = (Input tokens + Output tokens) ร— Unit price รท 1,000,000

Price List

ModelVendorInputOutput
Loading pricing data...

* All prices in USD per 1M tokens. See full pricing page for details.

Error Codes

KeyFrog uses standard HTTP status codes with OpenAI-compatible error responses.

CodeStatusDescription
401UnauthorizedInvalid or missing API key
403ForbiddenAPI key doesn't have permission, or key has been revoked
404Not FoundThe requested model or endpoint does not exist
429Rate LimitedToo many requests. Implement exponential backoff
500Server ErrorInternal server error. Retry with backoff

Error response format

All errors return a JSON body with an error object containing message, type, and code.

Rate Limits

Rate limits protect the platform and ensure fair usage for all users.

If you exceed the rate limit, you'll receive a 429 Too Many Requests response.

Best practices

  • Implement exponential backoff. Wait 1s, 2s, 4s, 8s between retries.
  • Batch requests when possible to reduce call volume.
  • Use streaming to reduce the number of API calls needed.
  • Cache responses for identical prompts when appropriate.
Need higher limits? Contact us at support@keyfrog.top for enterprise rate limits.

SDKs

Use KeyFrog with your favorite language. All OpenAI SDKs work out of the box.

Python

Install: pip install openai

The official OpenAI Python SDK works with KeyFrog by changing the base_url.

Node.js

Install: npm install openai

The official OpenAI Node.js SDK works identically.

Go

Use any HTTP client. The API is standard REST with JSON.

cURL

Works with any HTTP client. No SDK required.

FAQ

How do I get an API Key?
Sign up at the Dashboard, navigate to API Keys, and create a new key. You'll get a key starting with kf-.
How does billing work?
Pay-as-you-go. You're charged per token based on the model's unit price. No subscriptions or minimums. Check your usage in the Dashboard.
How do I switch models?
Simply change the model field in your request. All models share the same endpoint and API key. See the Models section for available models.
Is KeyFrog OpenAI compatible?
Yes, 100%. Just change the base_url to https://api.keyfrog.top/v1 and use your KeyFrog API key. All OpenAI SDK methods work โ€” chat completions, models list, streaming, etc.
What models are available?
58+ models from 14+ providers including DeepSeek, Qwen, GLM, Kimi, MiniMax, Llama, Mistral, and more. See the Models section or Models page for the full list.
Are there free models?
Yes. Models like glm-4-flash are completely free. Great for prototyping and low-cost applications.
Do you support streaming?
Yes. Set "stream": true in your request. All models support SSE streaming. See the Streaming section.
How do I get support?
Email us at support@keyfrog.top. We typically respond within a few hours.