Skip to content
OneHop

Model discovery

GET /v1/models returns the Onehop model catalog in an OpenAI-compatible list shape. Every item keeps the OpenAI core fields id, object, and owned_by, so strict clients can read data[].id without understanding the richer fields.

Use an API key, but this endpoint does not create usage records, charge credits, or forward requests to model providers.

Terminal window
curl https://api.onehop.ai/v1/models \
-H "Authorization: Bearer $ONEHOP_API_KEY"

OpenAI SDK

import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.ONEHOP_API_KEY,
baseURL: "https://api.onehop.ai/v1",
});
const models = await client.models.list();
console.log(models.data.map((model) => model.id));

For the strict OpenAI-compatible shape:

Terminal window
curl "https://api.onehop.ai/v1/models?compat=openai" \
-H "Authorization: Bearer $ONEHOP_API_KEY"

cc-switch

cc-switch-style clients can auto-detect Onehop through the standard OpenAI-compatible endpoint. They only need data[].id, which is always the canonical Onehop model slug such as openai/gpt-5.5.

Terminal window
curl "https://api.onehop.ai/v1/models?compat=openai" \
-H "Authorization: Bearer $ONEHOP_API_KEY" \
| jq -r ".data[].id"

OpenRouter-Style Fields

Use compat=openrouter when you want pricing, architecture, top_provider, and supported_parameters.

Terminal window
curl "https://api.onehop.ai/v1/models?compat=openrouter&supported_parameter=tools" \
-H "Authorization: Bearer $ONEHOP_API_KEY"

pricing is exposed as per-token strings for ecosystem compatibility. Onehop’s authoritative billing truth is under onehop.pricing.our; onehop.pricing.official is only a reference price.

ZenMux-Style Fields

Use compat=zenmux when you want grouped pricings such as prompt, completion, input_cache_read, image, video, or audio.

Terminal window
curl "https://api.onehop.ai/v1/models?compat=zenmux&input_modality=image" \
-H "Authorization: Bearer $ONEHOP_API_KEY"

Anthropic-Compatible List

Anthropic-compatible model discovery is available at /anthropic/v1/models. It lists only models that support the Anthropic Messages protocol.

Terminal window
curl https://api.onehop.ai/anthropic/v1/models \
-H "x-api-key: $ONEHOP_API_KEY"

Query Parameters

Common filters:

  • q: search by id, provider, summary, or alias
  • id: exact model id, alias, or provider model id
  • provider or owned_by: provider slug
  • protocol: openai_chat, openai_responses, anthropic_messages, openai_images, openai_sora, or google_vertex_ai
  • capability: for example reasoning, tool_calling, vision, or image_generation
  • input_modality / output_modality: for example text, image, audio, or video
  • supported_parameter: for example tools, temperature, reasoning, or max_tokens

Pagination and sorting:

  • limit: default 100, max 500
  • cursor: cursor returned as next_cursor
  • sort: display_order, id, created_desc, context_desc, price_prompt_asc, or price_completion_asc

Field control:

  • compat: onehop default, openai, openrouter, zenmux, or anthropic
  • include: comma-separated pricing, official_pricing, capabilities, protocols, or aliases