Uç noktalar
Responses
POST /responses ile OpenAI Responses API formatını kullanın; client.responses.create değişiklik gerektirmeden çalışır, parametreler, yanıt ve hatalar burada.
Playground’da deneResponses uç noktası OpenAI Responses API formatını kabul eder; bu yüzden resmi SDK'lardaki client.responses.create(...) değişiklik yapmadan çalışır. Chat completions ile aynı modeller üzerinde çalışır. api14 gövdeyi değiştirmeden sağlayıcıya iletir ve dönen usage değerini faturalandırır.
POST https://api14.com/api/v1/responses
Authorization: Bearer sk-api14-...
Content-Type: application/json
İstek
| Parametre | Tür | Açıklama |
|---|---|---|
model | string, zorunlu | Model kimliği, örn. openai/gpt-5-mini. |
input | string | array, zorunlu | Bir prompt dizesi veya girdi öğeleri dizisi ({ role, content } mesajları, function_call_output, …). |
instructions | string | Sistem düzeyinde yönergeler. |
stream | boolean | Anlamsal olayları (response.output_text.delta, response.completed, …) SSE ile stream eder. |
max_output_tokens | integer | Üretilecek token sayısının üst sınırı. |
temperature, top_p | number | Örnekleme ayarları. |
tools, tool_choice, parallel_tool_calls | Fonksiyon araçları. Web araması da araç olarak veya plugins aracılığıyla kullanılabilir. | |
text | object | Çıktı formatı, örn. { "format": { "type": "json_schema", "name": "...", "schema": {...} } }. |
reasoning | object | { "effort": "low" | "medium" | "high" }. Bkz. Reasoning. |
provider, models, plugins | Chat completions ile aynı ağ geçidi uzantıları. |
Ağ geçidi konuşmalarınızı saklamaz; bu yüzden her çağrıda tüm bağlamı input içinde geçin. previous_response_id gibi durum tutan seçenekler desteklenmeyebilir.
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api14.com/api/v1",
apiKey: process.env.API14_API_KEY,
});
const result = await client.chat.completions.create({
"model": "openai/gpt-5-mini",
"messages": [
{
"role": "user",
"content": "Explain vector databases in two sentences."
}
]
});
console.log(result.choices[0].message.content);
Yukarıdaki örnek chat completions kullanır. Node SDK'sıyla Responses karşılığı şöyle görünür:
const response = await client.responses.create({
model: "openai/gpt-5-mini",
input: "Write a haiku about APIs.",
});
console.log(response.output_text);
Yanıt
{
"id": "resp-1760000000-abc123",
"object": "response",
"created_at": 1760000000,
"model": "openai/gpt-5-mini",
"status": "completed",
"output": [
{
"type": "message",
"role": "assistant",
"content": [{ "type": "output_text", "text": "Requests in flight,\nJSON answers drifting back,\none key opens all." }]
}
],
"usage": {
"input_tokens": 14,
"output_tokens": 22,
"total_tokens": 36,
"input_tokens_details": { "cached_tokens": 0 },
"output_tokens_details": { "reasoning_tokens": 0 },
"cost": 0.0000475
}
}
Ağ geçidi usage değerini son nesneden, stream sırasında ise response.completed olayından okur ve cost tutarını USD olarak bakiyenizden düşer.
Hatalar
Chat completions ile aynıdır: 400 model_required, 400 invalid_json, 401 invalid_api_key, 402 insufficient_balance, 403 model_not_allowed / plan_required, 404 model_not_found, 413 payload_too_large, 429 rate_limited / daily_limit_reached, 502 upstream_unavailable. Bkz. Hatalar.