OpenAI Compatible
Completions
Responses
Non-Streaming
LLM
v1

Create a response (OpenAI-compatible, non-streaming)

Changed on

Creates a standard (non-streaming) completion response, compatible with the OpenAI response format. Use this endpoint as a drop-in replacement to create responses similar to OpenAI's chat/completions, but always returns the full response in a single payload. Requires API key authentication and is subject to rate limiting. Common use cases include chatbot interactions, assistant replies, and single-turn LLM completions.

post/v1/responses

Request

  • Base URL
    https://api.swarms.world
  • URL
    https://api.swarms.world/v1/responses
  • Auth
    none declared. Required headers: x-api-key

Headers

x-api-keystring required

Request body

modelstring required

Model to use. See GET /v1/models/available for the models you can use.

instructionsstring nullable

System prompt. Joined with any system or developer messages in input, in that order.

max_output_tokensinteger nullable

Maximum number of tokens to generate. When the limit is reached, status is incomplete with reason max_output_tokens.

temperaturenumber nullable

Sampling temperature, 0 to 2. Omitted by default so the model's own default applies.

top_pnumber nullable

Nucleus sampling cutoff.

Response

Successful Response

idstring required

Response identifier, resp_ prefixed.

object'response'
created_atinteger required

Unix time the response was created.

modelstring required

The model that answered.

status'completed' | 'incomplete' required

incomplete when max_output_tokens cut the answer short.

errorunknown

Changes