SwiftRelay

← All sprint notes

First Lap with the Responses API

Protocol pit stopEN

Your first lap starts with the request shape

The Responses API and Chat Completions API both let an application send input to a model and receive generated output. The important difference is how they organize that exchange. Chat completions centers on a list of messages. Responses centers on input and output items that can represent text, tool calls, and other supported content.

For a newcomer, think of chat completions as a conversation transcript and Responses as a container for a model interaction. You do not need to replace a working integration immediately. Start by understanding which shape fits the application you are building.

Chat completions keeps the message list familiar

With chat completions, your application usually sends a messages array containing instructions, user messages, and earlier assistant replies. The result commonly exposes an assistant message through a choices array. For a basic chatbot, that structure is straightforward: collect the conversation, send it, and display the reply.

Conversation history is generally your application's responsibility. On each turn, you decide which earlier messages to include. This gives you direct control over context, but it also means you must manage growing transcripts, tool results, and any trimming or summarization yourself.

Responses gives output more than one shape

With Responses, a simple request can use an input string, while more involved requests can supply structured input items. Output is also structured: one response may contain a message, a tool call, or several items. Some SDKs offer an output_text helper for collecting text, but that helper is not a substitute for inspecting tool-related output.

This matters when you move beyond displaying a paragraph. An application that only extracts text could overlook a request to run a function. Treat the output as structured data first, then choose what the user should see. Neither API makes generated content automatically correct or safe to execute.

Conversation state needs an explicit decision

The Responses API can support continuing an interaction through a previous response identifier, rather than requiring you to rebuild the entire transcript in every request. Availability and storage behavior depend on the service and configuration. Check retention controls before sending sensitive information.

A previous response identifier is not a promise of free context. Earlier content can still contribute to input usage. Also, do not assume that request-level instructions automatically carry forward when chaining responses; provide the instructions required for the current turn.

Tool support depends on the endpoint and provider

Both APIs can support function calling. Your application describes an available function, the model may request it, your code executes the approved action, and you return the result. The request and result formats differ, so migration requires more than changing an endpoint name.

Responses also provides an interface for supported built-in tools, but their availability is provider-specific. An OpenAI-compatible service does not necessarily implement every Responses feature. Check the exact endpoint, model, streaming events, and tool support you need before designing around them.

Your SwiftRelay checklist before the green light

SwiftRelay is a practical option when you want pay-as-you-go, per-token access to multiple model families through a relay. For OpenAI SDK configuration, use https://api.fastapirelay.com/v1 as the base URL. That configuration alone does not establish Responses support: confirm the endpoint and features for your selected model first.

  • Choose one small task: generate a short reply without tools or conversation history.
  • Inspect the result: verify where text, usage, errors, and tool requests appear.
  • Add a second turn: test your chosen approach to conversation context.
  • Exercise failure cases: handle unsupported parameters and interrupted streams.
  • Keep credentials private: make API calls from trusted server-side code.

Sign up for SwiftRelay to try that first request with the small gift credit available to new accounts. Keep working chat completions code until a Responses test demonstrates a concrete benefit for your application. The goal is a clear request, a correctly handled result, and no surprises about which features your provider supports.

Keep reading

Back for another lap?Log in