Capability
plungeai-models
Model routing on PlungeAI: how agents/workflows/missions resolve a model through the platform's provider factory (model/provider fields on a task, mission or POST /v1/agents/{id}/execute), and the separate OpenAI-compatible money-plane API (https://api.plungeai.com/v1/chat/completions, /v1/embeddings, /v1/models, plus the OpenRouter drop-in /api/v1) with your ozk_ key, models[] fallback routing, @preset/ bundles and response caching for your own code (ocean-cli models). Use when steering which model a task/mission runs on, calling chat/embeddings directly from your app, choosing fallback candidates across providers, reading usage/cost (/v1/generation, /v1/credits), or debugging a 4xx/5xx from /v1/chat/completions. For discovering agents/tools/models by capability use plungeai-discovery; for running an agent or tool use plungeai-agents / plungeai-tools-connectors; for authoring CNL workflows that steer model per task use plungeai-workflows.
Download zip (opens in a new tab) · View raw SKILL.md (opens in a new tab)
PlungeAI touches models in two distinct places, both opened by your one ozk_ key:
- Inside platform runs — agents, workflows, and missions resolve models
through the platform's provider factory (a fleet of per-provider
Workers behind one selection layer). You steer it with
model/providerfields on tasks and missions. - The money plane — an OpenAI-compatible inference API at
https://api.plungeai.com(/v1/chat/completions,/v1/embeddings,/v1/models) for YOUR code, with routing/fallback/caching on top.
Prerequisites
- Self-service
ozk_key from Dashboard → One API → Keys (https://dashboard.plungeai.com) — the same key opens agents/workflows/MCP and the money plane. - Legacy
sk-ocean-model keys are retired: none can be minted, existing ones are read-only under Keys → Legacy keys. - Base surfaces:
https://mcp.plungeai.com/v1(MCP) /https://api.plungeai.com(REST).
Discovery first
Model catalogs churn weekly. GET /v1/models (with your ozk_ key) is
the priced, live catalog routing candidates are drawn from — discover it at
runtime, never hardcode a model list in generated code.
1. Steering the model inside a run (provider factory)
Flat fields on a task, passed through to the agent:
- type: task
id: analyze
agent: one-agent
prompt: "…"
model: claude-sonnet-5
maxTokens: 4096Or on a harness mission (mission-level override):
- type: harness
agent: one-agent
goal: "…"
mission: |
You are a careful researcher.
model: claude-sonnet-5
provider: anthropicOmit model and the agent/provider default applies — usually the right
call. Full behavior (pattern-based capability detection so new model
generations work with no platform change, auto-continue on truncation,
per-task usage/cost) — references/provider-factory.md.
2. The money plane for your own code
Drop-in base_url swap for any OpenAI-compatible client:
curl -s https://api.plungeai.com/v1/chat/completions \
-H "Authorization: Bearer ozk_YOUR_KEY" -H "Content-Type: application/json" \
-d '{"model": "anthropic/claude-sonnet-5", "messages": [{"role": "user", "content": "Say hello"}]}'Ordered fallback across providers, reordered by rolling stats before the first attempt:
{"models": ["anthropic/claude-sonnet-5", "openai/gpt-5"], "sort": "price",
"messages": [{"role": "user", "content": "…"}]}Embeddings and the priced catalog:
curl -s https://api.plungeai.com/v1/embeddings \
-H "Authorization: Bearer ozk_YOUR_KEY" -H "Content-Type: application/json" \
-d '{"model": "openai/text-embedding-3-small", "input": ["hello", "world"]}'
curl -s https://api.plungeai.com/v1/models -H "Authorization: Bearer ozk_YOUR_KEY"Full request fields (models[], sort, @preset/<slug>, response cache,
guardrails), the complete error catalogue, and streaming —
references/money-plane.md.
Over the One API — every route of the plane
One ozk_ key, Authorization: Bearer only (no X-API-Key here). Setup: plungeai-api-setup.
| Route | Does |
|---|---|
POST /v1/chat/completions | OpenAI chat: model or models[] + sort, @preset/<slug>, stream; the answer's model is the slug that served it |
POST /v1/messages | the same money path on the Anthropic Messages wire (x-api-key or Authorization: Bearer, system, tools, tool_use/tool_result blocks, stream as message_start … message_stop events): any catalog model — anthropic/* gets the body as sent, every other model a translation; anthropic-beta is not forwarded; errors are Anthropic-shaped ({type: "error", error: {type, message}, request_id}) |
POST /v1/completions | legacy text completion: prompt is one string |
POST /v1/embeddings | {model, input} (string or array); openai, mistral, google and cohere models only (400 unsupported_provider) |
GET /v1/models | the priced catalog: {object: "list", data: [{id, owned_by, context_length, max_output, pricing: {in, out}, capabilities, …}]}, pricing in USD per 1M tokens |
GET /v1/models/{author}/{slug}/endpoints | the one endpoint that serves a model, with per-token pricing; 404 model_not_found |
GET /v1/pricing | public (no key, cached 60 s): every model Ocean sells — {object: "list", published_at, data: [{id, mode: "posted" | "passthrough", list: {in, out}, ocean: {in, out}, discount_pct, offers, …}]}, USD per 1M tokens; posted models carry Ocean's price and discount against the list price |
GET /v1/generation?id= | usage and cost of one completion (id = the x-request-id, or the gen-… id on /api/v1); 404 not_found for another account's id or one not written yet |
GET /v1/credits, GET /v1/key | {data: {total_credits, total_usage}} (USD); the calling key's label, monthly limit, usage and rate limit |
/api/v1/* | the same routes in OpenRouter's wire shape for an OpenRouter client: POST /api/v1/chat/completions, /messages, /embeddings, /completions, GET /api/v1/models, /generation, /credits, /key, /models/{author}/{slug}/endpoints; GET /api/v1/models is public, errors carry a numeric code |
MCP has no tool for the money plane: inside a run you steer the model with model/provider on
plungeai_execute_agent, a task or a harness mission. The CLI spells the plane ocean-cli models list | chat | embed.
What builders get wrong:
- Two id spellings.
GET /v1/modelsand the execute routes useprovider/model(anthropic/claude-sonnet-5);plungeai_list_agents {kind: "models"}andGET /v1/discovery/search?kind=modelsreturn registry cards whose ids readprovider:model. Take the slug fromGET /v1/models; on the money plane a bare name outside the short alias list is404 model_not_found. - A pinned model that is not in the catalog fails before the run starts (
422 unknown_modelonPOST /v1/agents/{id}/execute, with ahintto the discovery search) — sendprovidernext tomodelso a bare name cannot resolve to another provider. - Money-plane errors are OpenAI-shaped (
error.codeis a string such asinvalid_api_key); execution-plane routes use{error: {code, message}}, and/api/v1uses OpenRouter's numericcode. Branch on the HTTP status. - Cost is opt-in on the response (
usage: {include: true}); otherwise read thex-ocean-cost-usdheader orGET /v1/generation.
Gotchas
- One key, Bearer only on the money plane. The
ozk_key runs agents/tools/workflows/MCP and the money plane; the money plane takesAuthorization: Beareronly, notX-API-Key. - Honest billing. The response
modelfield is the slug that ACTUALLY served the request — after a failover it can differ from what you asked for. Bill, log, and display on the response value, never the requested one. - Never hardcode model slugs.
GET /v1/modelsis the only authority; populate any model picker in generated code from it at runtime. - Nested
configis a special case. Aconfig: {model, maxTokens}block is tolerated byone-agentonly (call mode flattens it) — use flat task fields for every other agent. - BYOK and guardrails are trust fences.
402 byok_required,403 model_not_allowed/content_blocked,429 spend_cap_exceeded— never engineer around them; surface and let the human/org decide.
Related skills
plungeai-discovery— find agents/tools/models/skills live, never from memory.plungeai-agents— execute a single agent (model/provideroverrides onplungeai_execute_agent/POST /v1/agents/{id}/execute).plungeai-tools-connectors— typed tool execution and contracts.plungeai-workflows— steermodel/providerper task or per harness mission in CNL YAML.plungeai-api-setup/plungeai-mcp-setup— connecting yourozk_key in the first place.