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

Authentication

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

Endpoints

EndpointMethodDescription
/chat/completionsPOSTText generation (chat, vision, tool use)
/images/generatePOSTImage generation
/images/editPOSTImage editing
/videos/generatePOSTVideo generation
/ai/queuePOSTAsync image/video generation
/media/generations/status/:namespace/*model_nameGETPoll async generation status
/media/generations/:namespace/:generation_idDELETECancel a queued generation
/evaluations/modelsGETList available models
/evaluations/models/:idGETGet model details and parameter schema

Common Parameters

These parameters are accepted across multiple endpoints:
ParameterTypeDescription
modelstringRequired. The model to use (e.g. gpt-4o-mini, 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 capability:
# All video models
curl -H "Authorization: Bearer $OXEN_API_KEY" \
  "https://hub.oxen.ai/api/evaluations/models?output_capability=video"

# Search by name
curl -H "Authorization: Bearer $OXEN_API_KEY" \
  "https://hub.oxen.ai/api/evaluations/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/evaluations/models/kling-video-o3-pro-reference-to-video"
The response includes a json_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
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, video_cost_per_second, video_cost_per_second_with_audio, video_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"
}
{
  "error": {
    "message": "Model not found: bad-model-name"
  }
}
Common error types: unauthenticated, invalid_params, resource_not_found, unknown_error.

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

Model References

Kling O3 Pro: Reference to Video

Multi-shot video with reference images, elements, and audio
Need help? Join our Discord community.