Skip to navigation

Step 5 API: Chat Completions, Messages and Responses

In short: Step 5 supports three API formats at api.stepfun.ai: Chat Completions, Messages and Responses. Compare requests, limits and SDK fit, plus our gateway docs.

Published 16 min read
On this page

Which three API formats does Step 5 support?

Step 5 supports three request formats on the StepFun platform: Chat Completions (OpenAI-compatible), Messages (Anthropic-compatible) and Responses (OpenAI Responses-compatible). The Step 5 model page says so in one line and lists the model id as step-5, with a 1M-token context window, a 64K maximum output, and text, image and video input. All three formats live under api.stepfun.ai, take the same key, and bill the same $1.00 input, $0.10 cached input and $2.70 output per 1M tokens. This post compares the three side by side and ties each to the SDK or agent that fits it; it belongs to the complete Step 5 guide.

The decision is smaller than it looks. If you already have code, use the format your code speaks. If you are choosing fresh, Chat Completions has the broadest tooling, Messages is the right door for Anthropic SDK and Claude Code style clients, and Responses is for clients that already use OpenAI’s newer request shape. Each has gaps you should know about before you commit, and the details below come from StepFun’s reference pages rather than from memory.

Which SDK or agent fits which endpoint?

Match the format to the client you already run, not to the model. The table lists the common pairings and the one wrinkle for each.

Client Format Base URL setting Wrinkle
OpenAI SDK (Python, Node), most chat apps Chat Completions https://api.stepfun.ai/v1 Reasoning arrives in a reasoning field, not in content
Anthropic SDK, Claude Code Messages https://api.stepfun.ai (no /v1) The SDK appends /v1/messages itself; max_tokens is required
OpenAI Responses clients, Codex-style agents Responses https://api.stepfun.ai/v1 Function tools only; image and video URLs must be publicly reachable
Step Plan subscribers, OpenAI SDK Chat Completions https://api.stepfun.ai/step_plan/v1 Subscription credits, same endpoint parameters
Step Plan subscribers, Anthropic SDK Messages https://api.stepfun.ai/step_plan (no /v1) Same rule: SDK appends /v1/messages

The Anthropic base URL rule appears twice in StepFun’s own pages. The Messages reference says Claude Code and the Anthropic SDK use the configured base URL and append /v1/messages, and its table lists https://api.stepfun.ai for the standard channel and https://api.stepfun.ai/step_plan for Step Plan. The Step Plan reasoning integration page warns that the Anthropic SDK must use the base URL without /v1, while the OpenAI SDK uses https://api.stepfun.ai/step_plan/v1. Getting this wrong is the commonest first-hour failure: a base URL with an extra /v1 sends requests to a path that does not exist.

Two more pairings are worth knowing. The Step Plan integration page lists only Chat Completions and Messages paths, with no Responses path, so a Responses-only client on a Step Plan key has no documented route there. And StepFun publishes integration pages for a long list of agents, including Claude Code, Codex CLI, Cursor, Cline, OpenCode, Hermes Agent, Kilo Code, Roo Code, Zed and others; the full list is in the StepFun documentation index. The Hermes Agent integration configures a custom OpenAI-style endpoint at the Step Plan base URL, which is the Chat Completions path. For how the agent tools use these formats in practice, see Step 5 in coding agent harnesses and how to access Step 5.

Pick the format by client

What speaks your client?Check the SDK or agent before the modelOpenAI SDK or chat appChat Completions, base URL ends in /v1Anthropic SDK or Claude CodeMessages, base URL has no /v1Responses clientResponses, function tools only

What does a request look like on each format?

Each format has a minimal skeleton, and the field names differ more than the ideas do. All three below set step-5, a reasoning level and an output cap; every field comes from the StepFun references, and the base URLs are the standard pay-as-you-go ones.

Chat Completions is the broadest. model and messages are required, max_tokens defaults to no limit (the model decides), and a user message can be a string or a list of text, image_url and video_url parts. The reply is choices[0].message.content, with reasoning in choices[0].message.reasoning and usage including cached_tokens.

Chat Completions with an image
from openai import OpenAI

client = OpenAI(api_key="YOUR_STEP_API_KEY", base_url="https://api.stepfun.ai/v1")

response = client.chat.completions.create(
  model="step-5",
  reasoning_effort="medium",
  max_tokens=8000,
  messages=[
      {
          "role": "user",
          "content": [
              {"type": "text", "text": "Summarize the trend in this chart."},
              {"type": "image_url", "image_url": {"url": "https://example.com/chart.png", "detail": "high"}},
          ],
      }
  ],
)
print(response.choices[0].message.content)
print(response.usage)

Messages is the Anthropic-compatible door. max_tokens is required, system is a top-level field, and content blocks are text, image, tool_use and tool_result. Reasoning effort goes in output_config. If your SDK version does not expose that field, the Anthropic SDKs accept extra body fields, so extra_body is the usual way to pass it through.

Messages with reasoning effort
from anthropic import Anthropic

# No /v1 here: the SDK appends /v1/messages itself.
client = Anthropic(api_key="YOUR_STEP_API_KEY", base_url="https://api.stepfun.ai")

message = client.messages.create(
  model="step-5",
  max_tokens=8000,
  system="You are a careful code reviewer.",
  messages=[{"role": "user", "content": "Review this function for race conditions."}],
  extra_body={"output_config": {"effort": "medium"}},
)
print(message.content)
print(message.usage)

Responses replaces messages with input and system with instructions. Content blocks are input_text, input_image and input_video. The cap is max_output_tokens, and it covers reasoning plus the answer. Output is an array of typed items: reasoning, message and function_call.

Responses with an image
from openai import OpenAI

client = OpenAI(api_key="YOUR_STEP_API_KEY", base_url="https://api.stepfun.ai/v1")

response = client.responses.create(
  model="step-5",
  instructions="Answer in one short paragraph.",
  input=[
      {
          "role": "user",
          "content": [
              {"type": "input_text", "text": "What changes between these two frames?"},
              {"type": "input_image", "image_url": {"url": "https://example.com/frame.png", "detail": "high"}},
          ],
      }
  ],
  reasoning={"effort": "medium"},
  max_output_tokens=8000,
)
print(response.output_text)
print(response.usage)

What stays the same: the model id, the price, the context window and the effort values. What changes: where the reasoning shows up in the reply, where the usage counts live, and which fields exist at all. The reasoning side of that is covered in Step 5 reasoning effort: low, medium, high, xhigh, max.

How do image and video inputs differ by format?

The limits are model-level and the same everywhere: up to 60 images per request in JPG, PNG, WebP or static GIF, as a URL or base64, with detail of low or high; video as URL, base64 or a stepfile:// Files API reference, in MP4, QuickTime or Matroska, with one MP4 under 128 MB and five minutes or shorter recommended. What differs is which formats expose which block.

Input Chat Completions Messages Responses
Image block image_url with url and optional detail image with a URL or base64 source input_image with a string or {url, detail} object
Video block video_url with url (reference: http or https, video/mp4) not in the documented block list input_video with a string or {url, detail} object
Detail setting low (default, about 400 tokens) or high not documented high or low in the object form
URL fetching Only http and https URLs URL or base64 URL must be publicly reachable from StepFun’s servers; base64 data URLs recommended for images

Three practical points follow from the table. First, if you need video, use Chat Completions or Responses. The Messages reference lists four content block types and video is not among them, so do not plan a video workflow on that format without testing it. Second, the Chat Completions reference describes the video URL as http or https, MP4, under 128 MB, while the model page also lists base64 and stepfile:// references. Treat the model page as the capability and the reference as the per-endpoint field; test the path you will ship. Third, the Responses reference says image and video URLs must be reachable from the server and recommends base64 data URLs for images, because authentication, hotlink protection or network blocks on external URLs produce parameter errors.

The low detail mode scales an image to a fixed size at around 400 tokens, and high uses a count that varies with the image. Since images bill as input tokens, a 60-image request at high can be large. The multimodal video input post covers the video side in depth, including what 128 MB and five minutes mean for real clips.

Horizontal bar chart in thousand tokens: Step 5 context window 1,000, Step 3.5 Flash context window 256, Step 5 maximum output 64.
Shared window. The 1M-token context is shared by input and output; one reply is capped at 64K. Images and video count as input tokens inside that window.

How do JSON Schema and tool calling differ?

Chat Completions and Responses both support strict JSON Schema; the Messages reference documents tools but no structured-output field. The JSON Mode and JSON Schema guide says Step 5 supports both modes. JSON Mode is response_format: {"type": "json_object"} and gives parseable JSON without field constraints; JSON Schema is response_format.type: "json_schema" with json_schema.strict: true, a name and a schema. The guide adds that schema constraints do not guarantee factual correctness, and that you should check finish_reason is stop: a length finish means the JSON may be truncated.

Capability Chat Completions Messages Responses
JSON Mode response_format json_object not documented text.format json_object
JSON Schema response_format json_schema, strict not documented text.format json_schema with name, strict, schema
Tool definition tools with type: function and function.name, description, parameters tools with name, description, input_schema tools with type: function, name, description, parameters, optional strict
Tool choice tool_choice="auto" appears in StepFun’s guide no tool_choice field listed only the string auto
Model asks for a tool message.tool_calls with id and JSON-string arguments tool_use block, stop_reason: tool_use function_call item with call_id
You return the result message with role: tool and tool_call_id tool_result block with tool_use_id, optional is_error function_call_output item with call_id and output

The Responses details matter if you build multi-turn agents. The reference says a function_call returned by the model must be passed back verbatim in later turns, and that only function tools are supported. The Responses reference also warns about output budgets: with JSON Schema, video, or the higher reasoning levels, reserve more output tokens, because max_output_tokens limits reasoning and the final answer together and a short budget can return status="incomplete".

A strict-schema request on Chat Completions looks like this, copied in shape from StepFun’s guide.

JSON Schema on Chat Completions
curl https://api.stepfun.ai/v1/chat/completions \
-H "Authorization: Bearer $STEP_API_KEY" \
-H "Content-Type: application/json" \
-d '{
  "model": "step-5",
  "messages": [{"role": "user", "content": "Extract the person: Wang Ming, age 28."}],
  "response_format": {
    "type": "json_schema",
    "json_schema": {
      "name": "person",
      "strict": true,
      "schema": {
        "type": "object",
        "additionalProperties": false,
        "required": ["name", "age"],
        "properties": {"name": {"type": "string"}, "age": {"type": "integer"}}
      }
    }
  },
  "max_tokens": 1024
}'

If you need structured output on the Messages format, the documented route is a tool with an input_schema that the model fills, then reading the tool_use input. That is a pattern, not a StepFun-published structured-output feature on that endpoint, so validate the result in your code either way. The tool calling guide also notes that tools run in your application: the model proposes a call and your code executes it. Function names should use English letters, numbers, underscores and hyphens, and StepFun recommends keeping them under 64 characters.

How does streaming work on each format?

All three formats stream over server-sent events, and the reasoning stream is separate from the answer. On Chat Completions, set stream: true and read chat.completion.chunk events; each delta can carry content, reasoning and tool_calls. The streaming guide makes the practical point that long generations feel broken without progress cues, and that streaming still has some latency, so show a loading indicator alongside it.

On Messages, the events are message_start, content_block_start, content_block_delta, content_block_stop, message_delta, message_stop and ping, and tool-call arguments stream as input_json_delta. On Responses, stream: true returns SSE and the final response object carries usage, including cached and reasoning token counts. For a reasoning model that thinks before it answers, streaming is not optional in production: a non-streaming call at a high effort level holds the connection open for the whole thinking time. Our own gateway documentation says it closes a stream after 300 seconds without any data, a limit worth remembering for any proxy in your path. See the streaming documentation for how that behaves.

What are the rate limits for pay-as-you-go keys?

Pay-as-you-go limits depend on cumulative cash top-up, and they apply across all three formats. The pricing and rate limits page lists five tiers for individual accounts, which must complete identity verification first; only cash top-ups count, vouchers do not, and Step Plan usage is governed by monthly credits instead.

Tier Cumulative top-up Concurrency RPM TPM
V0 Under $15 5 100 500,000
V1 $15 to $69 20 400 2,000,000
V2 $70 to $299 30 600 3,000,000
V3 $300 to $1,499 40 800 4,000,000
V4 $1,500 and above 130 2,600 13,000,000

For enterprise accounts, StepFun says to contact sales. It also says it may temporarily adjust tier limits when resources reach capacity, so treat the table as the baseline, not a guarantee.

Horizontal bar chart of requests per minute by StepFun individual tier: V0 100, V1 400, V2 600, V3 800, V4 2,600.
Requests per minute. From 100 at V0 to 2,600 at V4, by cumulative top-up.

Tokens per minute by tier, in thousands

  • V0 (under $15)500K
  • V1 ($15 to $69)2,000K
  • V2 ($70 to $299)3,000K
  • V3 ($300 to $1,499)4,000K
  • V4 ($1,500 and above)13,000K
Source: StepFun pricing and rate limits page, individual accounts.

Which limit binds first depends on your request size, and the arithmetic is quick. An agent call with a 40,000-token prompt at V0 can run at most 500,000 / 40,000 = 12.5 requests per minute before the token limit, well under the 100 RPM ceiling. The same call at V1 allows 2,000,000 / 40,000 = 50 per minute, and at V4 13,000,000 / 40,000 = 325. For long-context work, tokens per minute is the limit to plan around. StepFun’s page does not say in the passage we read whether cached tokens count toward TPM, so assume every prompt token counts until you confirm.

Concurrency is the other trap for reasoning models. If each request holds a slot for 48 seconds, the figure Artificial Analysis lists as Step 5’s time to first answer token with reasoning included, then 5 concurrent slots at V0 allow about 5 x (60 / 48) = 6.25 requests per minute, far below 100 RPM. At V1, 20 slots allow 25. That 48-second figure is an average from an index run, not a guarantee for your prompts, but it shows why a sweep or an agent fleet can hit the concurrency limit long before the request limit. The Step 5 reasoning effort levels post explains why higher levels hold slots longer, and the StepFun API pricing explainer covers what each tier of spend buys.

How do our gateway docs describe these three formats?

Our documentation describes three formats that line up with StepFun’s, with different coverage by model family. Step 5 is served on the first one only: step-5:free is an OpenAI-compatible Chat Completions id. The summary shows what each format covers and what to verify before you assume more.

  • Chat completions is documented as the one request format every model in the catalogue accepts, so it is the safest default for new code. Fields include reasoning_effort (low, medium or high on reasoning models), response_format for JSON Schema on models that honour it, tools, and stream_options. Claude models are translated.
  • Anthropic Messages is documented as the format for Claude models: Anthropic’s own API, with cache_control breakpoints and thinking blocks. The page states that for every other model you should use chat completions. For step-5:free use chat completions; the Anthropic Messages format for Step 5 is StepFun’s own endpoint.
  • Responses API is documented as supported for GPT and Claude models, stateless: the gateway does not store responses, so previous_response_id and background mode are not supported. For other families it depends on the provider’s own Responses support, and the page recommends chat completions where you do not need a Responses-only feature.

There are two other differences to keep in mind. Our reasoning documentation lists low, medium and high as the common values, with some models also accepting xhigh; whether max passes through for step-5:free is not something this post has verified, so test it before relying on it. And our gateway is one base URL and one key for many models, so switching a client from one model to another is one string. For the gateway itself, see what the gateway is and the API reference. If you want to try Chat Completions against Step 5 itself, the free models page lists step-5:free with the other ids, and the structured output and tool calling docs say which models honour which fields.

Which format should you choose?

What are you building?

A new app with an OpenAI SDK

Use Chat Completions at https://api.stepfun.ai/v1. It has the widest client support, image and video parts, strict JSON Schema and tools. Read reasoning from the reasoning field and set reasoning_effort.

A Claude Code or Anthropic SDK client

Use Messages with the base URL https://api.stepfun.ai (no /v1). Set max_tokens, pass output_config.effort, and do not plan on video input over this format until you have tested it.

A Responses-based agent

Use Responses. Define function tools only, leave tool_choice as auto, reserve a generous max_output_tokens, and prefer base64 images over external URLs.

A subscription (Step Plan) user

Use the /step_plan base URLs: https://api.stepfun.ai/step_plan/v1 for the OpenAI SDK and https://api.stepfun.ai/step_plan for the Anthropic SDK. Only Chat Completions and Messages paths are documented there.

I want one key across many models

A gateway lets one client call many models by changing a string. Ours is OpenAI- and Anthropic-compatible, and Step 5 is on it as step-5:free over Chat Completions, free inside the daily allowance (33 Step 5 requests a day). For paid routes see Step 5 on OpenRouter and Vercel AI Gateway.

What should you check before you ship?

Most integration bugs for a model like this are small and repeat, so a short checklist catches most of them. The first two items come straight from the documentation warnings; the rest come from the field limits above.

Step 5 API pre-flight

0 of 8 ticked

Not yet

Work through the base URL, output cap and streaming items first; they cause most first-week failures.

Run it on the free lane

The quickest Chat Completions test needs no StepFun account. step-5:free on our gateway has a 1M-token context window, up to 64K output, image input, reasoning and streaming, at $0 per token inside the free allowance of 100 requests and 3,000,000 tokens a day. Step 5 counts as 3 requests, so you get 33 a day, with one key per person and one request at a time. StepFun’s rate-limit tiers above apply to StepFun’s own API, not to this id.

python
from openai import OpenAI

client = OpenAI(base_url="https://api.oneaiapikey.com/v1", api_key="YOUR_API_KEY")
resp = client.chat.completions.create(
  model="step-5:free",
  stream=True,
  messages=[{"role": "user", "content": "Reply with the word ready."}],
)
for chunk in resp:
  print(chunk.choices[0].delta.content or "", end="")

Tool calling, the Messages route and the Responses route for Step 5 are features of StepFun’s API; this post does not claim them for the free id. See the Step 5 page for live stats.

What should you do next?

Pick the format your client speaks, write the three-line skeleton from this post, and send one request at medium with a small cap and stream: true. Check usage for cached tokens on the second call with the same prefix, and then compare the cost with the arithmetic in the prompt caching cost math post. If you need to rent the model through a third party instead of StepFun directly, read Step 5 on OpenRouter and Vercel AI Gateway, and if the question is whether to host weights at all, Step 5 API or Preview weights.

For the wider picture, start with the complete Step 5 guide, then read how to access Step 5 and Step 5 pricing. For comparisons with a peer at the same layer, see Step 5 vs Claude Sonnet 5.5. Before you build, check how one gateway key covers both formats: our gateway page describes the OpenAI- and Anthropic-compatible surfaces, and the quickstart gets a first request out in minutes on ids that answer today.

Try Step 5 on one key

Create an account, call step-5:free through chat completions, and keep the model string in config so moving to StepFun's own endpoints later is a one-line change.

FAQ

Which API formats does Step 5 support?
Chat Completions (OpenAI-compatible), Messages (Anthropic-compatible) and Responses (OpenAI Responses-compatible), all at api.stepfun.ai with the model id step-5. The Step 5 model page lists all three.
What base URL do I use for the Anthropic SDK?
Use https://api.stepfun.ai with no /v1, because the SDK appends /v1/messages. For Step Plan, use https://api.stepfun.ai/step_plan. For the OpenAI SDK, use https://api.stepfun.ai/v1, or https://api.stepfun.ai/step_plan/v1 on Step Plan.
Does the Messages format support video input?
The Messages reference lists text, image, tool use and tool result blocks only, so video is not documented there. Video is documented as video_url in Chat Completions and input_video in Responses. Test before you plan a video workflow on Messages.
Does Step 5 support JSON Schema and tool calling?
Yes. StepFun lists JSON Mode and JSON Schema, tool calling and streaming as supported features. Chat Completions and Responses document structured output fields; Messages documents tools but no structured-output field.
What are the default rate limits?
They depend on cumulative cash top-up. Below $15 an individual account gets 5 concurrent requests, 100 requests per minute and 500,000 tokens per minute; at $1,500 and above it gets 130, 2,600 and 13,000,000. Step Plan usage follows monthly credits instead.
Does the Responses API on StepFun store conversation state?
StepFun documents the request and response format, including function_call items you pass back verbatim. It does not describe stored conversation state in the reference we read. Send the full input each turn, as you would on Chat Completions.
Can I call Step 5 through One AI API Key?
Yes. Use step-5:free on https://api.oneaiapikey.com/v1/chat/completions. It is on the free lane at $0 per token, no card, 33 Step 5 requests a day (each counts as 3 of your 100). Messages and Responses for Step 5 are StepFun endpoints; our docs describe Messages for Claude and Responses for GPT and Claude.

Sources

More in Blog

Try it

One API key for GPT, Grok, DeepSeek, Kimi, GLM, MiniMax, Qwen, Step, Beam, Nemotron, ERNIE, Hunyuan, Gemma, Laguna, LFM, LongCat, Llama, Solar, Jais, Mistral, K2 and Roleplay.

One AI API Key speaks the OpenAI and Anthropic formats, so you change the base URL and the key, not your code. Credit packs start at $10, and every model has a published per-token rate.

New accounts$10 credit on sign-up
Claim $10 credit →