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.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.
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:- macOS / Linux
- Windows
Send a request
- Text chat
- Image understanding
- Video understanding
This example works with all three models. Replace
YOUR_MODEL_ID with the model you want to call.- Python
- cURL
Read the response
For a non-streaming request, generated content is available inchoices[0].message.content: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.

