GenX Router API

One API, 40+ AI models. Generate text, images, video, and audio with a single REST endpoint. No provider keys to manage. Built-in billing, webhooks, sessions, and file uploads.

Why GenX Router

GenX Router gives you one API endpoint for 40+ AI models across text, image, video, and audio. Instead of managing separate API keys, SDKs, and billing accounts for every provider, you get a single key and a unified interface.

  • 40+ models, one key — GPT-5.4, Claude, Gemini, Grok, Sora, Veo, Kling, and more. No provider accounts needed.
  • Stateful sessions — Multi-turn chat with automatic context management, compaction, and tool use (web search, code execution, file analysis).
  • File uploads — Upload PDFs, documents, and spreadsheets. Reference them in sessions across multiple messages.
  • Webhooks — Get notified when jobs complete. No polling required for production workloads.
  • Async by design — Submit a job, get a job ID, poll or receive a webhook. Works the same whether it takes 2 seconds or 2 minutes.
  • Volume discounts — Higher tiers unlock better pricing and higher rate limits automatically as you grow.

Quick Start

Three steps to your first generation:

  1. Create an account — Sign up at genx.sh and get 500 free credits.
  2. Create an API key — Go to Dashboard → API Keys. Your key starts with gnxk_.
  3. Make your first call
curl -X POST https://query.genx.sh/api/v1/generate \ -H "Authorization: Bearer gnxk_YOUR_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "claude-sonnet-4-6", "params": { "prompt": "Explain quantum computing in one paragraph" } }'
Base URL: https://query.genx.sh
All endpoints are under /api/v1.

How It Works

Authentication

Include your API key in every request using either method:

  • Authorization: Bearer gnxk_... (recommended)
  • X-Api-Key: gnxk_...

Generate → Poll (or Webhook)

All generation is asynchronous. You submit a job and get back a job ID immediately.

  1. POST /api/v1/generate — pick a model, send params, get a job_id back.
  2. GET /api/v1/jobs/:id — poll until status is completed or failed.
  3. On completion, result_url contains the output (text, image URL, video URL, etc.).

For production, register a webhook endpoint in your dashboard. GenX Router will POST to your URL when a job completes or fails — no polling needed. Webhook payloads include the full job result, usage metrics, and any metadata you attached.

Sessions (Multi-Turn Chat)

For conversational use cases, create a session instead of one-off generates. Sessions maintain message history, support system prompts, and handle context management automatically.

  • Tool use — Models can call web search, code execution, and custom functions within a session.
  • File context — Upload documents via /api/v1/files and reference them in messages.
  • Auto-compaction — When context fills up, summarize history to keep the conversation going.
  • Idempotent messages — Pass an idempotency_key for safe retries.

Metadata & Tracking

Attach up to 16 key-value pairs to any job via the metadata field. Use it to tag jobs with your own user IDs, project names, or tracking codes. Metadata is returned in job responses and webhook payloads.

Endpoints

Generate

POST /api/v1/generate
Submit a generation job. Returns a job ID immediately.
FieldTypeDescription
modelstringModel ID (e.g. claude-sonnet-4-6, grok-imagine). See model catalog.
paramsobjectModel-specific parameters (prompt, dimensions, duration, etc.)
metadataobject?Optional key-value pairs (up to 16 keys, string values)

Jobs

GET /api/v1/jobs/:id
Get job status, result URL, and usage.
GET /api/v1/jobs
List jobs. Supports ?status= filter and cursor pagination.
GET /api/v1/jobs/:id/result
Get just the result URL for a completed job.
GET /api/v1/jobs/:id/file
Download the result file directly.
POST /api/v1/jobs/:id/cancel
Cancel a queued or processing job.

Sessions

POST /api/v1/sessions
Create a chat session. Set the model, system prompt, and title.
POST /api/v1/sessions/:id/messages
Send a message and get the model's response. Supports text, images, files, and tool use.
GET /api/v1/sessions/:id/messages
Get message history with cursor pagination.
GET /api/v1/sessions
List sessions. Filter by model or status.
POST /api/v1/sessions/:id/compact
Summarize session history to free up context space.
POST /api/v1/sessions/:id/close
Close a session and clean up resources.

Files

POST /api/v1/files
Upload a file (PDF, DOCX, CSV, TXT, etc.). Max 100MB, up to 50 active files.
GET /api/v1/files/:id
Get file metadata.
DELETE /api/v1/files/:id
Delete an uploaded file.

Models

GET /api/v1/models
List all available models. Filter by ?category=text|image|video|audio.
GET /api/v1/models/:id
Get model details including category and provider.

Account

GET /api/v1/account/credits
Check wallet balance and available credits.
GET /api/v1/account/pricing
Get per-model pricing adjusted for your tier. Filter by ?category=.
GET /api/v1/account/pricing/:modelId
Get pricing for a specific model at your tier.

Code Examples

# Generate an image curl -X POST https://query.genx.sh/api/v1/generate \ -H "Authorization: Bearer gnxk_YOUR_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "grok-imagine", "params": { "prompt": "A futuristic city skyline at sunset" } }' # Poll for result curl https://query.genx.sh/api/v1/jobs/JOB_ID \ -H "Authorization: Bearer gnxk_YOUR_KEY" # Create a chat session curl -X POST https://query.genx.sh/api/v1/sessions \ -H "Authorization: Bearer gnxk_YOUR_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "claude-sonnet-4-6", "system_prompt": "You are a helpful assistant" }'
// Generate text with Claude Sonnet 4.6 const response = await fetch('https://query.genx.sh/api/v1/generate', { method: 'POST', headers: { 'Authorization': `Bearer ${API_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'claude-sonnet-4-6', params: { prompt: 'Write a haiku about AI' }, }), }); const { job_id } = await response.json(); // Poll for completion const result = await fetch( `https://query.genx.sh/api/v1/jobs/${job_id}`, { headers: { 'Authorization': `Bearer ${API_KEY}` } } ); const job = await result.json();
import requests # Generate a video with Veo 3.1 response = requests.post( "https://query.genx.sh/api/v1/generate", headers={ "Authorization": f"Bearer {API_KEY}", "Content-Type": "application/json", }, json={ "model": "veo-3.1", "params": { "prompt": "Aerial shot of ocean waves at golden hour", "duration": 8, "aspect_ratio": "16:9", }, }, ) job_id = response.json()["job_id"] # Poll for result result = requests.get( f"https://query.genx.sh/api/v1/jobs/{job_id}", headers={"Authorization": f"Bearer {API_KEY}"}, ) job = result.json()

Pricing

GenX Router uses credit-based billing powered by the DashNex Credits System — credits never expire and you can use them across the entire DashNex ecosystem. New accounts start with 500 free credits.

How Billing Works

  1. Submit a job — your balance is checked to ensure you have enough credits.
  2. Job completes — the actual cost is calculated from real usage metrics and charged on completion.
  3. Job failed? No charge. You only pay for successful generations.

Each model has per-metric pricing (tokens, images, audio seconds, video seconds, etc.). Check per-model rates in the model catalog or via GET /api/v1/account/pricing for your tier-adjusted prices.

Tiers

Tiers are earned automatically based on your cumulative top-up spend. Higher tiers get better pricing and higher rate limits.

TierDiscountRate LimitConcurrency
Starter10 RPM2
Blaze5% off60 RPM5
Agent10% off200 RPM10
Operator15% off500 RPM25

Enterprise

For companies building products on top of GenX Router, the Enterprise tier removes all rate limits and provides contract-based pricing.

Enterprise accounts get a Platform Secret that unlocks a powerful sub-key system:

  • Sub-keys for your users — Programmatically create API keys scoped to individual users in your platform via the Platform API. Each key is tied to an external ID you control.
  • Per-user usage tracking — Query usage by key or user. Build your own billing, quotas, or dashboards on top of GenX Router without managing any AI provider accounts.
  • Zero-config onboarding — New users are auto-provisioned on first key creation. No manual setup, no waiting.
  • Key lifecycle management — Create, list, and revoke keys programmatically. Full control over your user base.

This means you can offer AI capabilities to your own customers — text, image, video, audio — without integrating with a single provider directly. GenX Router handles the routing, billing, and infrastructure. You focus on your product.

Interested in Enterprise? Get in touch to discuss your use case.

Ready to Build?

Sign up for free and get 500 credits to start generating with 40+ AI models.