OneHop Docs

Models & discovery

List models, capabilities, supported parameters, and pricing.

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.

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

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

Model slugs

Every model has a canonical slug of the form provider/model, for example openai/gpt-5.5 or anthropic/claude-opus-4.8. Always pass the slug exactly as returned by /v1/models — that is the id your chat/completions, messages, and images requests should use.

Don't hard-code a flagship

Model availability changes over time. Read /v1/models at startup (or cache it briefly) rather than pinning a specific top-tier model id in source.

Using the 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:

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

Filter and sort

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

Pricing fields

Pricing is exposed for ecosystem compatibility. OneHop's authoritative billing truth lives under onehop.pricing.our; onehop.pricing.official is a reference price only. Use the compat views to match the ecosystem your tooling expects:

  • compat=openrouter adds pricing, architecture, top_provider, and supported_parameters.
  • compat=zenmux adds grouped pricings such as prompt, completion, input_cache_read, image, video, or audio.
  • include=pricing,capabilities,protocols,aliases adds individual sections to the default onehop view.
curl "https://api.onehop.ai/v1/models?compat=openrouter&supported_parameter=tools" \
  -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.

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