Create a response

Create a model response. Optionally reference a previous response by ID to continue a multi-turn conversation with server-managed state, instead of resending the full message history.

POST /responses

Generate a model response.

Request body

Content Type: application/json

CreateResponse

Response

HTTP 200 — OK

Content Type: application/json

Response

Content Type: text/event-stream

ResponseStreamEvent

python
import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.meta.ai/v1",
api_key=os.environ["MODEL_API_KEY"],
)
response = client.responses.create(
model="muse-spark-1.3",
input="What is the capital of France?",
)
print(response.model_dump_json(indent=2))

For usage examples, previous_response_id patterns, and guidance on when to use the Responses API versus Chat Completions, see the Responses feature page.