OpenAI ChatGPT API

OpenAI

OpenAI API 中繼

POST /ardswc/api/openai/v1/responses

Responses API (新版對話介面,支援 streaming)。

curl https://www.myai168.com/ardswc/api/openai/v1/responses \
  -H "Authorization: Bearer YOUR_DEV_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"gpt-5.5","input":"Hello"}'
import requests

r = requests.post(
    "https://www.myai168.com/ardswc/api/openai/v1/responses",
    headers={"Authorization": "Bearer YOUR_DEV_KEY"},
    json={"model": "gpt-5.5", "input": "Hello"},
)
print(r.json())

POST /ardswc/api/openai/v1/chat/completions

Chat Completions API (舊版對話介面,相容 OpenAI SDK)。

curl https://www.myai168.com/ardswc/api/openai/v1/chat/completions \
  -H "Authorization: Bearer YOUR_DEV_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"gpt-5.5","messages":[{"role":"user","content":"Hello"}]}'
import requests

r = requests.post(
    "https://www.myai168.com/ardswc/api/openai/v1/chat/completions",
    headers={"Authorization": "Bearer YOUR_DEV_KEY"},
    json={"model": "gpt-5.5", "messages": [{"role": "user", "content": "Hello"}]},
)
print(r.json())

POST /ardswc/api/openai/v1/audio/speech

文字轉語音 (TTS),回 audio binary。

curl https://www.myai168.com/ardswc/api/openai/v1/audio/speech \
  -H "Authorization: Bearer YOUR_DEV_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"tts-1","input":"Hello","voice":"nova"}' \
  --output speech.mp3
import requests

r = requests.post(
    "https://www.myai168.com/ardswc/api/openai/v1/audio/speech",
    headers={"Authorization": "Bearer YOUR_DEV_KEY"},
    json={"model": "tts-1", "input": "Hello", "voice": "nova"},
)
with open("speech.mp3", "wb") as f:
    f.write(r.content)

POST /ardswc/api/openai/v1/audio/transcriptions

語音轉文字 (STT, multipart upload)。

curl https://www.myai168.com/ardswc/api/openai/v1/audio/transcriptions \
  -H "Authorization: Bearer YOUR_DEV_KEY" \
  -F file=@audio.mp3 \
  -F model=gpt-4o-transcribe
import requests

with open("audio.mp3", "rb") as f:
    r = requests.post(
        "https://www.myai168.com/ardswc/api/openai/v1/audio/transcriptions",
        headers={"Authorization": "Bearer YOUR_DEV_KEY"},
        files={"file": f},
        data={"model": "gpt-4o-transcribe"},
    )
print(r.json())

POST /ardswc/api/openai/v1/audio/translations

語音翻譯成英文 (STT + translate)。

curl https://www.myai168.com/ardswc/api/openai/v1/audio/translations \
  -H "Authorization: Bearer YOUR_DEV_KEY" \
  -F file=@audio.mp3 \
  -F model=gpt-4o-transcribe
import requests

with open("audio.mp3", "rb") as f:
    r = requests.post(
        "https://www.myai168.com/ardswc/api/openai/v1/audio/translations",
        headers={"Authorization": "Bearer YOUR_DEV_KEY"},
        files={"file": f},
        data={"model": "gpt-4o-transcribe"},
    )
print(r.json())

POST /ardswc/api/openai/v1/images/generations

文字生圖 (gpt-image-2)。

curl https://www.myai168.com/ardswc/api/openai/v1/images/generations \
  -H "Authorization: Bearer YOUR_DEV_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"gpt-image-2","prompt":"A cute cat","size":"1024x1024"}'
import requests

r = requests.post(
    "https://www.myai168.com/ardswc/api/openai/v1/images/generations",
    headers={"Authorization": "Bearer YOUR_DEV_KEY"},
    json={"model": "gpt-image-2", "prompt": "A cute cat", "size": "1024x1024"},
)
print(r.json())

其他常見問題頁面

  • 常見問題
  • 帳戶問題
  • 功能問題
  • 隱私權
  • Anthropic Claude API
  • Google Gemini API
  • Google News API
  • OpenRouter API
  • API 收費
  • OpenCode
  • OpenClaw
  • Hermes Agent
  • Claude Code CLI
  • Codex CLI
  • MYAI168 MCP CLI
  • MYAI168 MCP 網頁及應用程式