Skip to main content

List Models

GET /api/ai/models
Lists all available models. OpenAI-compatible.

Query Parameters

ParameterTypeRequiredDescription
developer_namestringnoFilter by developer (e.g. openai, anthropic, google)
actionstringnoFilter by fine-tuning action type

Response

{
  "object": "list",
  "data": [
    {
      "id": "claude-sonnet-4-6",
      "object": "model",
      "created": 1750000000,
      "owned_by": "oxen",
      "display_name": "Claude Sonnet 4.6",
      "description": "Anthropic's balanced model for a wide range of tasks",
      "summary": "Balanced performance and speed",
      "model_type": "base",
      "endpoint": "/chat/completions",
      "capabilities": {
        "input": ["text", "image"],
        "output": ["text"]
      },
      "pricing": {
        "method": "token",
        "input_cost_per_token": 3e-6,
        "output_cost_per_token": 1.5e-5
      },
      "fine_tuning": null,
      "deployments": [],
      "developer": {
        "name": "Anthropic",
        "logo": "https://..."
      },
      "source_model": null,
      "image_url": null,
      "released_at": "2025-06-19T00:00:00Z",
      "request_schema": null
    }
  ]
}

Examples

import requests

response = requests.get(
    "https://hub.oxen.ai/api/ai/models",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
)

for model in response.json()["data"]:
    print(f"{model['id']} ({model['endpoint']})")

Search Models

GET /api/ai/models/search
Search models by name.

Query Parameters

ParameterTypeRequiredDescription
searchstringyesSearch query

Examples

import requests

response = requests.get(
    "https://hub.oxen.ai/api/ai/models/search",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    params={"search": "kling"},
)

for model in response.json()["data"]:
    print(f"{model['id']} - {model['display_name']}")

Retrieve Model

GET /api/ai/models/:id
Retrieves a model by name. Returns the full model object including the request_schema describing model-specific parameters.

Path Parameters

ParameterTypeRequiredDescription
idstringyesModel name (e.g. claude-sonnet-4-6, flux-2-dev)

Query Parameters

ParameterTypeRequiredDescription
deployment_statusstringnoPass "live" to refresh deployment status from provider before responding

Examples

import requests

response = requests.get(
    "https://hub.oxen.ai/api/ai/models/kling-video-o3-pro-reference-to-video",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
)

model = response.json()
print(f"Endpoint: {model['endpoint']}")
print(f"Pricing: {model['pricing']}")

# Get the model's parameter schema
if model.get("request_schema"):
    print(f"Parameters: {model['request_schema']}")

Activate Model

POST /api/ai/models/:id/activate
Activates an inactive custom model deployment. Base models are always active and do not need activation.

Path Parameters

ParameterTypeRequiredDescription
idstringyesModel name

Examples

import requests

response = requests.post(
    "https://hub.oxen.ai/api/ai/models/my-custom-model/activate",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
)

model = response.json()
print(f"Status: {model['deployments'][0]['status']}")

Deactivate Model

POST /api/ai/models/:id/deactivate
Deactivates an active custom model deployment to stop billing.

Path Parameters

ParameterTypeRequiredDescription
idstringyesModel name

Examples

import requests

response = requests.post(
    "https://hub.oxen.ai/api/ai/models/my-custom-model/deactivate",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
)

model = response.json()
print(f"Status: {model['deployments'][0]['status']}")

Model Object

Every endpoint above returns one or more model objects with this schema:
FieldTypeDescription
idstringModel identifier used in API calls (e.g. claude-sonnet-4-6)
objectstringAlways "model"
createdintegerUnix timestamp when the model was registered
owned_bystring"oxen" for base models, owner namespace for custom models
display_namestringHuman-readable name
descriptionstring/nullFull description
summarystring/nullBrief summary
model_typestring"base" or "custom"
endpointstringAPI endpoint to call: "/chat/completions", "/images/generate", or "/videos/generate"
capabilitiesobjectInput/output modalities, e.g. input: ["text", "image"], output: ["text"]
pricingobjectSee Pricing below
fine_tuningobject/nullFine-tuning config with actions and cost_per_second, or null if not fine-tuneable
deploymentsarrayDeployment status objects. Possible statuses: active, inactive, deploying, deactivating, error, unknown. Empty for base models.
developerobject/nullDeveloper info with name and logo fields
source_modelstring/nullBase model this was fine-tuned from
image_urlstring/nullImage asset URL
released_atstring/nullRelease timestamp
request_schemaobject/nullJSON Schema describing model-specific request parameters

Pricing

The pricing object describes how the model is billed:
FieldTypeDescription
methodstring"token", "time", "per_image", or "per_video_output_second"
input_cost_per_tokennumber/nullCost per input token (token-based models)
output_cost_per_tokennumber/nullCost per output token (token-based models)
cost_per_secondnumber/nullCost per second (time-based models)
cost_per_imagenumber/nullFixed cost per image (image generation models)
cost_per_second_high_resnumber/nullHigh-resolution video cost per second
cost_per_second_with_audionumber/nullVideo with audio cost per second

Errors

ConditionStatusError
Model not found404"Model not found: <name>"
Not authenticated401"unauthenticated"