Relay docs

Responses & tools

#Responses shim

POST /v1/responses — a minimal implementation of the OpenAI Responses API, mapped onto the chat pipeline (non-streaming). It accepts an input and returns an output / output_text, so clients written against the Responses API can target Relay for simple cases.

curl -X POST http://localhost:5300/v1/responses \
  -H "Authorization: Bearer $RELAY_API_KEY" -H "Content-Type: application/json" \
  -d '{ "model": "gpt-4o", "instructions": "Be brief.", "input": "Give me three store-opening checklist items.", "temperature": 0.2 }'
FieldMeaning
modelPublic alias (or an auto strategy).
inputA string, or an array of { role, content } messages whose content is a string — a content-parts array is passed to the model as raw JSON text, not as parts.
instructionsBecomes the system prompt.
temperatureForwarded.
streamIgnored; the shim always answers in one piece.

The response contains an output array (one assistant message), a convenience output_text, and usage as input_tokens / output_tokens / total_tokens. Tool calls are not returned — only the text of the first choice. Under the hood this runs the same routing, caching, idempotency and tracing pipeline as a non-streaming chat completion, and carries the same X-Relay-* headers.

For streaming, images, tool calling and full feature coverage, prefer /v1/chat/completions or the agents endpoint.

#Tool registry

GET /v1/tools — returns the function-tool registry in OpenAI tool shape, so an app can discover the tools available to advertise to a model:

{ "object": "list", "data": [
  { "type": "function", "function": { "name": "get_order_status", "description": "…", "parameters": { "type": "object", "properties": { "order_id": { "type": "string" } }, "required": ["order_id"] } } }
] }

Tools are authored in the panel under Tools and attached to agents. The listing is every enabled tool in the registry, in the shape a chat request's tools array takes; a tool whose stored parameters are missing or invalid is listed with an empty object schema. When an agent is backed by an MCP server, Relay executes matching tool calls itself; otherwise the tool_calls are handed back to your app to execute. See Skills, tools & MCP.