HOSTED MOCK API REFERENCE
OpenAI Responses API mock: completion and partial output
Check a Responses client against completed JSON, incremental SSE text and function_call output. Treat an error after text deltas differently from a stream that reaches clean EOF before terminal completion; partial text alone does not establish success.
Explore mock APIsNew registration is paused. Explore the public mock APIs; existing users can still sign in.
Existing user? Configure OpenAI Responses API · Workspace pricing and limits · Supported operations and behaviours
What to assert in your client
Select complete, error and cutoff streams as separate tests. Interrupted streams end cleanly, not with a TCP reset. Output and timing are fixed; no model generates content, no tool executes, and rate limits and spend caps are selected responses rather than live account checks.
Request and selected response examples
Generate Response: Temporary rate limit
Documented Synthetic illustrative example from the catalogue, not a live capture. Run only after installing your own receiver. Replace <your-receiver-token> locally; no request is sent from this page.
HTTP 429 · rate_limit_error · slow_down · Retry-After: 5
curl / Bash request
printf '%s' '{"model":"gpt-4.1","input":"Say hello"}' | \
curl -i -X POST \
'https://nottherealapi.com/r/<your-receiver-token>/v1/responses' \
-H 'Authorization: Bearer synthetic-openai-token' \
-H 'Content-Type: application/json' \
--data-binary @-PowerShell request
$body = '{"model":"gpt-4.1","input":"Say hello"}'
Invoke-WebRequest `
-UseBasicParsing `
-Uri 'https://nottherealapi.com/r/<your-receiver-token>/v1/responses' `
-Method POST `
-Headers @{
Authorization = 'Bearer synthetic-openai-token'
} `
-ContentType 'application/json' `
-Body ([Text.Encoding]::UTF8.GetBytes($body))Selected synthetic response
HTTP 429
content-type: application/json
retry-after: 5
x-ratelimit-limit-requests: 60
x-ratelimit-remaining-requests: 0
x-ratelimit-reset-requests: 1s
{
"error": {
"message": "Request rate increased too quickly. Reduce traffic and retry.",
"type": "rate_limit_error",
"code": "slow_down"
}
}Stream Response: Error event after partial text
Representative Synthetic illustrative example from the catalogue, not a live capture. Run only after installing your own receiver. Replace <your-receiver-token> locally; no request is sent from this page.
HTTP 200 · SSE · Stream error after partial output
curl / Bash request
printf '%s' '{"model":"gpt-4.1","input":"Say hello","stream":true}' | \
curl -i --no-buffer -X POST \
'https://nottherealapi.com/r/<your-receiver-token>/v1/responses' \
-H 'Authorization: Bearer synthetic-openai-token' \
-H 'Content-Type: application/json' \
--data-binary @-PowerShell request
$body = '{"model":"gpt-4.1","input":"Say hello","stream":true}'
Invoke-WebRequest `
-UseBasicParsing `
-Uri 'https://nottherealapi.com/r/<your-receiver-token>/v1/responses' `
-Method POST `
-Headers @{
Authorization = 'Bearer synthetic-openai-token'
} `
-ContentType 'application/json' `
-Body ([Text.Encoding]::UTF8.GetBytes($body))Selected synthetic response
HTTP 200
content-type: text/event-stream; charset=utf-8
event: response.created
data: {"type":"response.created","response":{"id":"resp_example_001","object":"response","created_at":1792238400,"model":"gpt-4.1","status":"in_progress","error":null,"incomplete_details":null,"output":[],"parallel_tool_calls":true,"tools":[],"tool_choice":"auto","metadata":{},"usage":null},"sequence_number":0}
event: response.in_progress
data: {"type":"response.in_progress","response":{"id":"resp_example_001","object":"response","created_at":1792238400,"model":"gpt-4.1","status":"in_progress","error":null,"incomplete_details":null,"output":[],"parallel_tool_calls":true,"tools":[],"tool_choice":"auto","metadata":{},"usage":null},"sequence_number":1}
event: response.output_item.added
data: {"type":"response.output_item.added","output_index":0,"item":{"id":"msg_example_001","type":"message","role":"assistant","status":"in_progress","content":[]},"sequence_number":2}
event: response.content_part.added
data: {"type":"response.content_part.added","item_id":"msg_example_001","output_index":0,"content_index":0,"part":{"type":"output_text","text":"","annotations":[],"logprobs":[]},"sequence_number":3}
event: response.output_text.delta
data: {"type":"response.output_text.delta","item_id":"msg_example_001","output_index":0,"content_index":0,"delta":"Hello ","logprobs":[],"sequence_number":4}
event: error
data: {"type":"error","code":"server_error","message":"Synthetic mid-stream failure","param":null,"sequence_number":5}
Events above are the fixed fixture sequence. Delivery timing is simulated; see the full behaviour list for completion, error and early EOF choices.
AI Responses API · v1
What can I test with this?
Test a Responses API client without calling OpenAI or using a real API key. Simulate completed JSON responses, incremental text streams and function-call output. Exercise authentication errors, rate limits, spend caps, model overload, partial stream failures, delayed responses and malformed JSON.
Responses HTTP v1 snapshot reviewed 17 October 2026. Authentication error fields are representative; the public error guide establishes HTTP 401 but not this exact discriminator/code pair. Fixed output and timing; no model or tool executes. Interrupted streams end cleanly before completion and do not simulate a TCP reset.
Useful for
- SDK and client integration
- Stream handling
- Function calls
- Rate limits and spend caps
- Parsing and deadline handling
Supported operations
3 operationsGenerate Response
POST /v1/responses
Sends a JSON input request and receives a completed Responses API object or the selected error, delayed or malformed response.
Request content type: application/json
Request example
{
"model": "gpt-4.1",
"input": "Say hello"
}Available behaviours (8)
Response completed
RepresentativeRepresentative Responses API output object with synthetic data.
HTTP 200 · completed
Verify that your client handles a successful response.
Invalid API key
RepresentativeBearer API key is rejected.
HTTP 401 · invalid_request_error · invalid_api_key
Test credential refresh and authentication recovery.
Invalid request
RepresentativeMalformed or unsupported request parameter.
HTTP 400 · invalid_request_error · invalid_value
Test field mapping and useful validation feedback.
Temporary rate limit
Documented429 transient rate limit with Retry-After and rate-limit metadata.
HTTP 429 · rate_limit_error · slow_down · Retry-After: 5
Verify bounded backoff and retry handling.
- Honor Retry-After, reduce traffic, then increase gradually.
Project spend cap
DocumentedHard project spend limits return 429 but need an account change, not retrying.
HTTP 429 · insufficient_quota · project_spend_limit_exceeded
Check that persistent allocation or billing limits do not cause endless retries.
- Do not retry until the project limit or billing state changes.
Model temporarily overloaded
Documented503 model overload; retry with increasing delay when Retry-After is supplied.
HTTP 503 · service_unavailable_error · server_is_overloaded
Test recovery and error reporting during simulated service failures.
- Honor Retry-After and back off.
Delayed response
SyntheticArtificial delay for client deadlines.
HTTP 200 · completed · 1800 ms delay
Exercise client deadlines and timeout recovery.
Malformed JSON body
SyntheticSynthetic invalid JSON despite JSON content type.
HTTP 200
Verify that response parsing fails safely.
Stream Response
POST /v1/responses
Sends a JSON request with stream: true. Receives text/event-stream events with incremental text, a completed response, an error after partial output or a synthetic interruption.
Request content type: application/json
Request example
{
"model": "gpt-4.1",
"input": "Say hello",
"stream": true
}Available behaviours (3)
Text lifecycle and completed response
DocumentedOrdered response, output item, content part and text events.
HTTP 200 · SSE · Stream completes
Check stream progress, completion and partial-output handling.
Error event after partial text
RepresentativeRepresentative error after a valid partial text lifecycle; error message is synthetic.
HTTP 200 · SSE · Stream error after partial output
Check stream progress, completion and partial-output handling.
Interrupted stream
SyntheticSynthetic clean EOF before a terminal event; this is not a TCP reset.
HTTP 200 · SSE · Interrupted before completion
Check stream progress, completion and partial-output handling.
Tool Call
POST /v1/responses
Sends a Responses API request and receives a function_call output item for the client to handle. The mock returns the selected output without executing a tool.
Request content type: application/json
Request example
{
"model": "gpt-4.1",
"input": "Look up order",
"tools": [
{
"type": "function",
"name": "lookup_order",
"parameters": {
"type": "object",
"properties": {
"order_id": {
"type": "string"
}
},
"required": [
"order_id"
],
"additionalProperties": false
},
"strict": true
}
],
"tool_choice": {
"type": "function",
"name": "lookup_order"
}
}Available behaviours (1)
Function call returned
RepresentativeA function_call has a call_id and JSON-encoded arguments; no tool is executed.
HTTP 200 · completed
Verify that your client understands this provider-specific outcome.
What NotTheRealAPI controls
NotTheRealAPI does not call OpenAI. No real provider account is required. Your integration sends the request to a NotTheRealAPI receiver and receives the selected provider-shaped response.
The receiver stays under NotTheRealAPI at /r/<receiver-token> followed by the operation path. Selecting a behaviour controls the simulated response on that same receiver.
New registration is paused. Sign in to use this module
Scope and safe testing
This independent simulation has no live OpenAI connection or endorsement and does not claim complete API compatibility. No real provider credentials are required. Outcomes remain selected until you change them; these provider fixtures do not persist business records or transition autonomously.
Use synthetic data only. Receiver URLs are secrets. Captured headers and bounded bodies are visible to authorised workspace members without automatic redaction; see privacy and retention.
NotTheRealAPI independently simulates third-party APIs for testing. All provider names and logos are the property of their respective owners. NotTheRealAPI is not affiliated with, sponsored by or endorsed by those providers, and these modules do not connect to their live services. Twilio and all related logos are trademarks of Twilio Inc. or its affiliates.
Browse the full mock API catalogue · Anthropic Messages API mock: content blocks and stream failures · Compare workspace limits and pricing · Sign in

