Skip to main content

What is the Inference API?

The Inference API gives you access to hundreds of AI models through a single, consistent interface. Generate text, images, and videos without managing infrastructure or juggling multiple provider SDKs. Capabilities:
  • Text Generation: Chat completions, tool calling, vision, structured output
  • Image Generation: Text-to-image, image-to-image editing
  • Video Generation: Text-to-video, image-to-video, reference-to-video, video-to-video editing

Quick Starts

Chat

Text generation in minutes

Image Generation

Text-to-image in minutes

Video Generation

Text-to-video in minutes

API Reference

Chat Completions

Text generation, vision, tool calling

Image Generation

Text-to-image generation

Image Editing

Edit images with text prompts

Video Generation

Text-to-video, image-to-video, multi-shot

Async Queue

Background image/video generation

Models

List, search, and manage models

Model References

Kling O3 Pro: Reference to Video

Multi-shot video with reference images, elements, and audio

Kling O3 Pro: Video to Video Edit

Edit existing videos with text instructions and reference images

Seedance 2.0: Reference to Video

Generate video from text, images, video, and audio references

Topaz Starlight Precise 2.5

Video upscaling and restoration up to 4K

Authentication

All requests require a bearer token:
curl -H "Authorization: Bearer YOUR_API_KEY" \
  https://hub.oxen.ai/api/ai/...
Get your API key from your account settings.

Base URL

All inference endpoints live under:
https://hub.oxen.ai/api/ai
If you’re using the OpenAI SDK, set the base URL to https://hub.oxen.ai/api/ai. The SDK appends /chat/completions automatically.

Endpoints

EndpointMethodDescription
/ai/chat/completionsPOSTText generation (chat, vision, tool use)
/ai/images/generatePOSTImage generation
/ai/images/editPOSTImage editing
/ai/videos/generatePOSTVideo generation
/ai/queuePOSTAsync image/video generation
/ai/queueGETList queued generations
/ai/queue/:generation_idGETGet generation status
/ai/queue/:generation_idDELETECancel a queued generation
/ai/modelsGETList available models
/ai/models/:idGETGet model details and parameter schema
/ai/models/searchGETSearch models by name
/ai/models/:id/activatePOSTActivate a custom model deployment
/ai/models/:id/deactivatePOSTDeactivate a custom model deployment

Common Parameters

These parameters are accepted across multiple endpoints:
ParameterTypeDescription
modelstringRequired. The model to use (e.g. claude-sonnet-4-6, flux-2-dev, kling-video-o3-pro-reference-to-video).
response_formatstring"url" (default) returns a hosted URL. "b64_json" returns base64-encoded bytes inline. Supported on image and video endpoints.
target_namespacestringNamespace to save results and bill to. Defaults to your user. Can be an organization name.

Discovering Models

List all models, optionally filtered by developer:
# All models
curl -H "Authorization: Bearer $OXEN_API_KEY" \
  "https://hub.oxen.ai/api/ai/models"

# Search by name
curl -H "Authorization: Bearer $OXEN_API_KEY" \
  "https://hub.oxen.ai/api/ai/models/search?search=kling"
Get full details for a specific model (including its parameter schema):
curl -H "Authorization: Bearer $OXEN_API_KEY" \
  "https://hub.oxen.ai/api/ai/models/kling-video-o3-pro-reference-to-video"
The response includes a request_schema field with the complete parameter definitions, types, defaults, and constraints for that model.

Pricing

Pricing varies by model:
MethodHow it worksExamples
tokenPer input/output tokenGPT, Claude, Gemini
timePer second of compute timeCustom models, Llama, Qwen
per_imageFixed cost per imageFLUX, DALL-E
per_video_output_secondCost per second of output videoKling, Sora
Check the model detail endpoint for exact pricing. Relevant fields: input_cost_per_token, output_cost_per_token, cost_per_image, cost_per_second, cost_per_second_with_audio, cost_per_second_high_res.

Error Format

Errors use one of two formats:
{
  "error": {
    "type": "invalid_params",
    "title": "Invalid parameters supplied, please check your request and try again.",
    "detail": "Specific error details"
  },
  "status": "error",
  "status_message": "invalid_params"
}
{
  "error": {
    "message": "Model not found: bad-model-name"
  }
}
Common error types: unauthenticated, invalid_params, resource_not_found, unknown_error. Need help? Join our Discord community.