Use this file to discover all available pages before exploring further.
Provides Responses for all closed source providers: openai, and anthropic.The Responses API is the unified successor to Chat Completions: you send input (text, images, files, tool outputs, etc.) and receive a response object that can contain messages, tool calls, and (for reasoning models) reasoning items.Note, anthropic does not yet support tool calls.To specify a provider, prefix the model with the provider. For example, gpt-5.1 should be passed as openai/gpt-5.1.
All Anthropic models should support thinking.⚠️ max_output_tokens limits reasoning tokens + visible output tokens, so if you increase reasoning.effort, consider raising max_output_tokens.
Basic usage (Closed Source + Thinking)
import OpenAI from "openai";const client = new OpenAI({ apiKey: "BYTEZ_KEY", baseURL: "https://api.bytez.com/models/v2/openai/v1"});const response = await client.responses.create({ model: "openai/gpt-5.1", input: [ { role: "system", content: "You are a friendly chatbot" }, { role: "user", content: "Hello bot, what is the capital of England?" } ], // Thinking controls (OpenAI reasoning models only) reasoning: { effort: "medium", // try: "none" | "low" | "medium" | "high" (model-dependent) summary: "auto" // "none" | "auto" | "detailed" }, // Caps reasoning + visible output tokens together max_output_tokens: 300});console.log("Answer:", response.output_text);// Optional: read a reasoning summary item (if requested & returned)const reasoningItem = response.output?.find((it) => it.type === "reasoning");if (reasoningItem?.summary?.length) { console.log("Reasoning summary:", reasoningItem.summary.map(s => s.text).join("\n"));}