Responses
OpenAI's Responses API, served by every text model here.
POST /v1/responses is OpenAI's newer text API and the one their SDK now defaults to. It takes an input (a prompt or a conversation), and answers with an output array plus an output_text convenience field. If your code says client.responses.create(...), changing the base URL is the whole migration.
A request
curl https://api.routehook.ai/v1/responses \
-H "Authorization: Bearer $ROUTEHOOK_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-4o-mini",
"input": "Summarise the difference between a hold and a charge."
}'
POST/v1/responsesAvailable
OpenAI's Responses API, served by every text model on the platform rather than one vendor's.
Carrying a conversation
input takes a list of role/content items as well as a string, and that is how a conversation is continued here. Send the turns you already have; the reply is appended by your own code, not by us.
const response = await client.responses.create({
model: "openai/gpt-4o-mini",
instructions: "Answer in one sentence.",
input: [
{ role: "user", content: "What is a credit hold?" },
{ role: "assistant", content: "A reservation taken before a request runs." },
{ role: "user", content: "When is it released?" },
],
});
Streaming
Set stream: true and the answer arrives as server-sent events in this API's own vocabulary: response.created, then response.output_text.delta per token, then response.output_text.done and response.completed carrying the final object and its usage. A failure before the first byte is an ordinary JSON error with a real status; after it, an error event inside the stream. The split described on the [Errors](/docs/errors) page.
Streamed
const stream = await client.responses.create({
model: "openai/gpt-4o-mini",
input: "Count to five.",
stream: true,
});
for await (const event of stream) {
if (event.type === "response.output_text.delta") {
process.stdout.write(event.delta);
}
}
Truncation is reported honestly
A model cut off by max_output_tokens comes back with status: "incomplete" and incomplete_details.reason: "max_output_tokens", not completed. A client that retries on truncation depends on that distinction, and reporting a cut-off answer as finished is the one status mistake that silently corrupts whatever consumes the text.