Responses
OpenAI Responses API endpoint. The Sakrylle gateway treats this as the native OpenAI platform entry point.
Protocol boundary
This is the OpenAI Responses format. Anthropic-backed groups may be reachable through gateway translation, but if you need Anthropic-native tool or content-block semantics, prefer /v1/messages.
Compatibility note
By default Sakrylle routes OpenAI traffic through this endpoint. If your API key's group has been marked "Claude Code only" by an administrator, requests to /v1/responses are rejected. For most cases the more familiar /v1/chat/completions is recommended.
Endpoint
POST https://api.sakrylle.com/v1/responsesHeaders
| Name | Required | Description |
|---|---|---|
Authorization | Yes | Bearer sk-xxxxxxxxxxxxxxxx |
Content-Type | Yes | application/json |
Accept | No | Set text/event-stream for streaming |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | OpenAI model ID, e.g. gpt-5.6-sol |
input | string | array | Yes | User input — a string, or an array of messages / content blocks |
instructions | string | No | System-level directives, equivalent to chat's system |
stream | boolean | No | Defaults to false; true returns SSE events |
temperature | number | No | 0–2 |
top_p | number | No | Nucleus sampling probability |
max_output_tokens | integer | No | Maximum output tokens |
tools | array | No | Tool / function definitions |
tool_choice | string | object | No | auto / none / a specific tool |
metadata | object | No | Arbitrary KV; echoed back in the response |
previous_response_id | string | No | Continue a previous response |
The gateway only validates that
modelis present and the body is valid JSON; the rest passes through.
Example request
{
"model": "gpt-5.6-sol",
"instructions": "You are a concise assistant.",
"input": "Introduce yourself."
}Example response
{
"id": "resp_xxxxxxxxxxxxxxxx",
"object": "response",
"created_at": 1716350400,
"model": "gpt-5.6-sol",
"status": "completed",
"output": [
{
"id": "msg_xxxxxxxxxxxxxxxx",
"type": "message",
"role": "assistant",
"content": [
{
"type": "output_text",
"text": "I'm gpt-5.6-sol. How can I help you?"
}
]
}
],
"usage": {
"input_tokens": 22,
"output_tokens": 14,
"total_tokens": 36
}
}Streaming response
With stream: true, the server returns SSE events such as response.created, response.output_text.delta, and response.completed:
event: response.created
data: {"type":"response.created","response":{"id":"resp_xxx","model":"gpt-5.6-sol","status":"in_progress"}}
event: response.output_text.delta
data: {"type":"response.output_text.delta","delta":"Sakrylle"}
event: response.output_text.delta
data: {"type":"response.output_text.delta","delta":" API"}
event: response.completed
data: {"type":"response.completed","response":{"id":"resp_xxx","status":"completed","usage":{"input_tokens":22,"output_tokens":14,"total_tokens":36}}}Errors
400 invalid_request_error— missingmodelor invalid JSON401 authentication_error— invalid API key403 permission_error— group restricted to "Claude Code only" rejects/v1/responses403 billing_error— balance or plan quota exhausted429 rate_limit_error— concurrency or rate limit502 upstream_error/server_error— upstream repeatedly failed, please retry later
For the full table, see Errors.
Code samples
curl https://api.sakrylle.com/v1/responses \
-H "Authorization: Bearer sk-xxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-5.6-sol",
"input": "Hello!"
}'from openai import OpenAI
client = OpenAI(
api_key="sk-xxxxxxxxxxxxxxxx",
base_url="https://api.sakrylle.com/v1",
)
resp = client.responses.create(
model="gpt-5.6-sol",
input="Hello!",
)
print(resp.output_text)import OpenAI from "openai";
const client = new OpenAI({
apiKey: "sk-xxxxxxxxxxxxxxxx",
baseURL: "https://api.sakrylle.com/v1",
});
const resp = await client.responses.create({
model: "gpt-5.6-sol",
input: "Hello!",
});
console.log(resp.output_text);package main
import (
"bytes"
"io"
"net/http"
"fmt"
)
func main() {
body := []byte(`{"model":"gpt-5.6-sol","input":"Hello!"}`)
req, _ := http.NewRequest("POST",
"https://api.sakrylle.com/v1/responses",
bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer sk-xxxxxxxxxxxxxxxx")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
out, _ := io.ReadAll(resp.Body)
fmt.Println(string(out))
}use reqwest::Client;
use serde_json::json;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let client = Client::new();
let resp: serde_json::Value = client
.post("https://api.sakrylle.com/v1/responses")
.bearer_auth("sk-xxxxxxxxxxxxxxxx")
.json(&json!({
"model": "gpt-5.6-sol",
"input": "Hello!"
}))
.send()
.await?
.json()
.await?;
println!("{resp:#}");
Ok(())
}import java.net.URI;
import java.net.http.*;
public class Responses {
public static void main(String[] args) throws Exception {
String body = """
{"model":"gpt-5.6-sol","input":"Hello!"}
""";
HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://api.sakrylle.com/v1/responses"))
.header("Authorization", "Bearer sk-xxxxxxxxxxxxxxxx")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(body))
.build();
HttpResponse<String> resp = HttpClient.newHttpClient()
.send(req, HttpResponse.BodyHandlers.ofString());
System.out.println(resp.body());
}
}using System.Net.Http.Headers;
using System.Text;
var http = new HttpClient();
http.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("Bearer", "sk-xxxxxxxxxxxxxxxx");
var payload = """
{"model":"gpt-5.6-sol","input":"Hello!"}
""";
var resp = await http.PostAsync(
"https://api.sakrylle.com/v1/responses",
new StringContent(payload, Encoding.UTF8, "application/json"));
Console.WriteLine(await resp.Content.ReadAsStringAsync());