Skip to main content
This guide provides a common set of API examples. Select a model ID from the table, then use the tabs below to switch between text chat, image understanding, and video understanding.

Choose a model ID

Replace YOUR_MODEL_ID in the examples below with one of the model IDs in the table, and replace YOUR_STEP_API_KEY with your API key.

Get an API key

Sign in to the StepFun Open Platform and create and copy an API key on the Interface Keys page.

Set up your environment

Install the Python dependency

The Python examples use the OpenAI SDK:

Send a request

This example works with all three models. Replace YOUR_MODEL_ID with the model you want to call.

Read the response

For a non-streaming request, generated content is available in choices[0].message.content:
The full response also includes the request ID, token usage, and other fields. See the Chat Completions API for details.If a request fails, use the returned error information and refer to the error codes documentation.

Explore further

Model capability overview

Compare the positioning and capabilities of Step 5 Preview, Step 3.7 Flash, and Step 3.5 Flash.

Image understanding best practices

Learn about image formats, input methods, and parameter recommendations.

Video understanding best practices

Learn about video input methods, limits, and common issues.

API reference

See the complete request parameters, response fields, and usage information.