POST /jp/api/openai/v1/responsesResponses API (新版對話介面,支援 streaming)。
curl https://www.myai168.com/jp/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/jp/api/openai/v1/responses",
headers={"Authorization": "Bearer YOUR_DEV_KEY"},
json={"model": "gpt-5.5", "input": "Hello"},
)
print(r.json())
POST /jp/api/openai/v1/chat/completionsChat Completions API (舊版對話介面,相容 OpenAI SDK)。
curl https://www.myai168.com/jp/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/jp/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 /jp/api/openai/v1/audio/speech文字轉語音 (TTS),回 audio binary。
curl https://www.myai168.com/jp/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/jp/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 /jp/api/openai/v1/audio/transcriptions語音轉文字 (STT, multipart upload)。
curl https://www.myai168.com/jp/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/jp/api/openai/v1/audio/transcriptions",
headers={"Authorization": "Bearer YOUR_DEV_KEY"},
files={"file": f},
data={"model": "gpt-4o-transcribe"},
)
print(r.json())
POST /jp/api/openai/v1/audio/translations語音翻譯成英文 (STT + translate)。
curl https://www.myai168.com/jp/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/jp/api/openai/v1/audio/translations",
headers={"Authorization": "Bearer YOUR_DEV_KEY"},
files={"file": f},
data={"model": "gpt-4o-transcribe"},
)
print(r.json())
POST /jp/api/openai/v1/images/generations文字生圖 (gpt-image-2)。
curl https://www.myai168.com/jp/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/jp/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())