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
Response
HTTP 200 — OK
Content Type: application/json
Content Type: text/event-stream
pythonimport osfrom openai import OpenAIclient = 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))
pythonimport jsonimport osimport requestsresponse = requests.post("https://api.meta.ai/v1/responses",headers={"Authorization": f"Bearer {os.environ['MODEL_API_KEY']}","Content-Type": "application/json",},json={"model": "muse-spark-1.3","input": "What is the capital of France?",},)response.raise_for_status()print(json.dumps(response.json(), indent=2))
shellcurl -X POST "https://api.meta.ai/v1/responses" \-H "Authorization: Bearer $MODEL_API_KEY" \-H "Content-Type: application/json" \-d '{"model": "muse-spark-1.3","input": "What is the capital of France?"}'
For usage examples, previous_response_id patterns, and guidance on when to use the Responses API versus Chat Completions, see the Responses feature page.