One API key for every model you build with
Call leading language models through an OpenAI-compatible endpoint, and generate images, video, audio and 3D through one queue API. Same key, same wallet.
Keep the OpenAI SDK you already use. Only the base URL and the key change.
curl https://www.genspark.ai/api/v1/chat/completions \
-H "Authorization: Bearer $GENSPARK_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-sonnet-5-5",
"messages": [{"role": "user", "content": "Write a haiku about queues."}]
}'import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["GENSPARK_API_KEY"],
base_url="https://www.genspark.ai/api/v1",
)
r = client.chat.completions.create(
model="claude-sonnet-5-5",
messages=[{"role": "user", "content": "Write a haiku about queues."}],
)
print(r.choices[0].message.content)import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.GENSPARK_API_KEY,
baseURL: "https://www.genspark.ai/api/v1",
});
const r = await client.chat.completions.create({
model: "claude-sonnet-5-5",
messages: [{ role: "user", content: "Write a haiku about queues." }],
});
console.log(r.choices[0].message.content);# Submit, then poll the status_url from the 202 response.
curl -X POST https://www.genspark.ai/api/v1/queue/fal-ai/flux-3 \
-H "Authorization: Bearer $GENSPARK_API_KEY" \
-H "Content-Type: application/json" \
-d '{"prompt": "A lighthouse at dawn, film photo"}'What you can call
Text and media models behind one base URL.
-
Text
Chat Completions and Responses, with streaming. Models from OpenAI, Anthropic, Google and more.
-
Image
Text-to-image and image-to-image generation.
-
Video
Text-to-video and image-to-video, with first and last frame control on supported models.
-
Audio
Speech, music and sound effects.
-
3D
Text-to-3D and image-to-3D worlds and meshes.
Built for production
-
OpenAI compatible
Point the OpenAI SDK, or any client that accepts a custom OpenAI base URL, at Genspark.
-
One key, every modality
The same key calls chat models and the media queue. No per-vendor accounts to manage.
-
One team wallet
An organization admin tops up the API wallet and every member key draws from it. It is separate from Genspark membership credits.
-
Per-key controls
Scope each key, allow or deny models, set a spend cap and a concurrency limit. Rotate the secret without changing the key id.
-
Request log and usage
Every call is recorded with its model, status and cost, and can be filtered by key.
-
Queue API with webhooks
Submit long-running media jobs, then poll, follow the status stream, or receive a signed webhook when the result is ready.
First call in three steps
-
Fund the API wallet
An organization admin adds funds to the API wallet.
-
Create a key
Open the API platform, create a key and copy the secret. It is shown once.
-
Make a call
Set the base URL and send your first request.
Base URLhttps://www.genspark.ai/api/v1
Works with the OpenAI SDKs and with clients that accept a custom OpenAI base URL, such as Cursor, Cline, ChatBox and GenOffice.
Questions
Who can use GensparkRouter?
It is rolling out to Genspark Team organizations. Members of an organization with the API platform switched on can create keys.
Does it work with the OpenAI SDK?
Yes. Chat Completions and Responses follow the OpenAI format. Set the base URL and use your Genspark key.
How is usage billed?
Text models are billed per token and media models per generation, at each model’s listed price. Charges come from your organization’s prepaid API wallet, which is separate from Genspark membership credits.
What can an API key access?
Only model calls. A key cannot reach any other Genspark product or the data in your Genspark account.
Am I charged for a media request that does not finish?
No. A request that fails, is refused by content moderation, times out, or is cancelled while queued is refunded.
Start building
Create a key in the API platform and make your first call.
Get API key