Back to pricing

GPT-4 Turbo

chat
OpenAI
Per token

高性能大上下文模型,适合复杂推理与长文本任务。

Model ID: gpt-4-turbo
Billing: Per token/1K tokens
OpenAI-compatible endpoint with a single model key
Pricing Info

$0.0300/1K tokens

Market Price

$0.0600/1K tokens

Model Documentation
Using default documentation template for this model.

GPT-4 Turbo Documentation

Use this model with OpenAI-compatible SDKs.

Endpoint

  • Base URL: https://your-domain.com/v1
  • Model key: gpt-4-turbo

JavaScript / TypeScript (Official OpenAI SDK)

ts
import OpenAI from 'openai'

const client = new OpenAI({
  apiKey: process.env.NEW_API_KEY,
  baseURL: 'YOUR_BASE_URL'
})

const completion = await client.chat.completions.create({
  model: 'YOUR_MODEL_ID',
  messages: [
    { role: 'system', content: 'You are a helpful assistant.' },
    { role: 'user', content: 'Give me a quick intro for this model.' }
  ]
})

console.log(completion.choices[0]?.message?.content)

Python (Official OpenAI SDK)

python
from openai import OpenAI

client = OpenAI(
    api_key="YOUR_NEW_API_KEY",
    base_url="YOUR_BASE_URL"
)

resp = client.chat.completions.create(
    model="YOUR_MODEL_ID",
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "Hello!"}
    ]
)

print(resp.choices[0].message.content)