hengm3467 commited on
Commit
ee8c807
·
1 Parent(s): 1678751

clarify regional base_url and use env vars in examples

Browse files

- add callout in Examples section with Global vs China base_url table
- switch 5.1 and 5.2 to read STEP_API_KEY and STEP_BASE_URL from env
- label platform.stepfun.ai/.com with Global/China in Availability bullet

Files changed (1) hide show
  1. README.md +25 -3
README.md CHANGED
@@ -41,7 +41,7 @@ Step 3.7 Flash is built for live engineering tasks and secured a definitive seco
41
  | Output | $1.15 / M tokens |
42
 
43
  ## 4. Availability, Deployment, and Ecosystem
44
- - Availability: Step 3.7 Flash is available through StepFun Open Platform at platform.stepfun.ai and platform.stepfun.com, as well as partner platforms including OpenRouter and NVIDIA NIM.
45
  - Deployment: Step 3.7 Flash supports flexible deployment across cloud, data center, and local environments. For large-scale production and enterprise use cases, Step 3.7 Flash can be deployed on modern data center infrastructure. For local and workstation scenarios, it can also run on high-memory devices such as NVIDIA DGX Station, AMD Ryzen AI Max+ 395-based systems, and Mac Studio / Macbook Pro devices with at least 128GB unified memory.
46
  - Ecosystem: Step 3.7 Flash is supported across popular open-source infrastructure for both inference and model development. For inference and serving, developers can use vLLM, SGLang, Hugging Face Transformers, and llama.cpp. For model development workflows, StepFun model support has landed in the NVIDIA Megatron ecosystem, including Megatron Core and Megatron Bridge.
47
 
@@ -49,12 +49,30 @@ Step 3.7 Flash is built for live engineering tasks and secured a definitive seco
49
 
50
  You can get started with Step 3.7 Flash in minutes using StepFun's API or via other inference providers.
51
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  ### 5.1 Chat Example
53
 
54
  ```python
 
55
  from openai import OpenAI
56
 
57
- client = OpenAI(api_key="STEP_API_KEY", base_url="https://api.stepfun.com/v1")
 
 
 
58
 
59
  completion = client.chat.completions.create(
60
  model="step-3.7-flash",
@@ -76,9 +94,13 @@ print(completion)
76
  ### 5.2 Text and Image Input Example
77
 
78
  ```python
 
79
  from openai import OpenAI
80
 
81
- client = OpenAI(api_key="STEP_API_KEY", base_url="https://api.stepfun.com/v1")
 
 
 
82
 
83
  completion = client.chat.completions.create(
84
  model="step-3.7-flash",
 
41
  | Output | $1.15 / M tokens |
42
 
43
  ## 4. Availability, Deployment, and Ecosystem
44
+ - Availability: Step 3.7 Flash is available through StepFun Open Platform [platform.stepfun.ai](https://platform.stepfun.ai) (Global) and [platform.stepfun.com](https://platform.stepfun.com) (China) — as well as partner platforms including OpenRouter and NVIDIA NIM.
45
  - Deployment: Step 3.7 Flash supports flexible deployment across cloud, data center, and local environments. For large-scale production and enterprise use cases, Step 3.7 Flash can be deployed on modern data center infrastructure. For local and workstation scenarios, it can also run on high-memory devices such as NVIDIA DGX Station, AMD Ryzen AI Max+ 395-based systems, and Mac Studio / Macbook Pro devices with at least 128GB unified memory.
46
  - Ecosystem: Step 3.7 Flash is supported across popular open-source infrastructure for both inference and model development. For inference and serving, developers can use vLLM, SGLang, Hugging Face Transformers, and llama.cpp. For model development workflows, StepFun model support has landed in the NVIDIA Megatron ecosystem, including Megatron Core and Megatron Bridge.
47
 
 
49
 
50
  You can get started with Step 3.7 Flash in minutes using StepFun's API or via other inference providers.
51
 
52
+ > **Note — pick the right `base_url` for your region.** StepFun operates two regional platforms with separate API hosts. The `base_url` you pass to the OpenAI client **must** match the platform where your API key was issued, otherwise requests will be rejected as unauthorized.
53
+ >
54
+ > | Platform | Console | `base_url` |
55
+ > |---|---|---|
56
+ > | Global | [platform.stepfun.ai](https://platform.stepfun.ai) | `https://api.stepfun.ai/v1` |
57
+ > | China | [platform.stepfun.com](https://platform.stepfun.com) | `https://api.stepfun.com/v1` |
58
+ >
59
+ > To avoid hard-coding the wrong region, the examples below read both values from environment variables. Export them once before running:
60
+ >
61
+ > ```bash
62
+ > export STEP_API_KEY="sk-..."
63
+ > export STEP_BASE_URL="https://api.stepfun.ai/v1" # use https://api.stepfun.com/v1 for the China platform
64
+ > ```
65
+
66
  ### 5.1 Chat Example
67
 
68
  ```python
69
+ import os
70
  from openai import OpenAI
71
 
72
+ client = OpenAI(
73
+ api_key=os.environ["STEP_API_KEY"],
74
+ base_url=os.environ["STEP_BASE_URL"],
75
+ )
76
 
77
  completion = client.chat.completions.create(
78
  model="step-3.7-flash",
 
94
  ### 5.2 Text and Image Input Example
95
 
96
  ```python
97
+ import os
98
  from openai import OpenAI
99
 
100
+ client = OpenAI(
101
+ api_key=os.environ["STEP_API_KEY"],
102
+ base_url=os.environ["STEP_BASE_URL"],
103
+ )
104
 
105
  completion = client.chat.completions.create(
106
  model="step-3.7-flash",