Responses
Overview
Section titled “Overview”Available Operations
Section titled “Available Operations”- create - Create response
create
Section titled “create”Create a response with streaming support. This endpoint corresponds to OpenAI’s Responses API.
Example Usage
Section titled “Example Usage”from r9s import R9S
with R9S(api_key=os.getenv("R9S_API_KEY",""),) as r9_s:
res = r9_s.responses.create(model="gpt-4o-mini", input="Tell me a joke about programming", instructions="You are a funny assistant", temperature=0.7, max_output_tokens=500, stream=False)
for event in res: # handle event print(event, flush=True)Parameters
Section titled “Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
model | str | :heavy_check_mark: | Model name |
input | Input | :heavy_check_mark: | Input content, required parameter. Can be: - String: Single text input - Message array: Structured conversation history Important limitations: - Messages only support basic fields (role, content, name) - Does not support tool_calls, tool_call_id and other tool-related fields - content field is required and cannot be null - To use tools, define them in the top-level tools parameter; model will call them on first response Note: Responses API has deprecated messages parameter, now uses input parameter uniformly |
instructions | str | :heavy_minus_sign: | System-level instructions to guide model behavior and response style (similar to system message) |
temperature | float | :heavy_minus_sign: | Controls output randomness, higher values mean more random |
top_p | float | :heavy_minus_sign: | Nucleus sampling parameter, controls output diversity |
max_output_tokens | int | :heavy_minus_sign: | Maximum number of tokens to generate |
stream | bool | :heavy_minus_sign: | Whether to enable streaming |
modalities | Array<string (text, audio)> | :heavy_minus_sign: | Response modality types |
tools | Array | :heavy_minus_sign: | Available tools list (using nested format) |
tool_choice | object | :heavy_minus_sign: | Tool selection strategy |
metadata | object | :heavy_minus_sign: | Additional metadata |
retries | object | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
Response
Section titled “Response”CreateResponseResponse
Errors
Section titled “Errors”| Error Type | Status Code | Content Type |
|---|---|---|
| errors.BadRequestError | 400 | application/json |
| errors.AuthenticationError | 401 | application/json |
| errors.PermissionDeniedError | 403 | application/json |
| errors.UnprocessableEntityError | 422 | application/json |
| errors.RateLimitError | 429 | application/json |
| errors.InternalServerError | 500 | application/json |
| errors.ServiceUnavailableError | 503 | application/json |
| errors.R9SDefaultError | 4XX, 5XX | */* |