Developer Documentation
gpt-oss-120b API Documentation
Complete API integration guide with Python, Node.js, and cURL examples. Integrate OpenAI models in 5 minutes.
Code Examples
Python
from openai import OpenAI
# 配置 GetGoAPI
client = OpenAI(
api_key="YOUR_GETGOAPI_KEY", # 从 https://getgoapi.com 获取
base_url="https://api.getgoapi.com/v1"
)
# 调用 gpt-oss-120b
response = client.chat.completions.create(
model="gpt-oss-120b",
messages=[
{"role": "user", "content": "Hello, how are you?"}
]
)
print(response.choices[0].message.content)Node.js
import OpenAI from 'openai';
// 配置 GetGoAPI
const client = new OpenAI({
apiKey: 'YOUR_GETGOAPI_KEY', // 从 https://getgoapi.com 获取
baseURL: 'https://api.getgoapi.com/v1'
});
// 调用 gpt-oss-120b
async function main() {
const response = await client.chat.completions.create({
model: 'gpt-oss-120b',
messages: [
{ role: 'user', content: 'Hello, how are you?' }
]
});
console.log(response.choices[0].message.content);
}
main();cURL
curl https://api.getgoapi.com/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_GETGOAPI_KEY" \
-d '{
"model": "gpt-oss-120b",
"messages": [
{
"role": "user",
"content": "Hello, how are you?"
}
]
}'API Parameters
| Parameter | Type | Description |
|---|---|---|
| model | string | Model name: gpt-oss-120b |
| messages | array | Chat messages array |
| temperature | number | Sampling temperature (0-2), default 1 |
| max_tokens | number | Maximum output tokens |