Sluiceline

Mock behaviour

The response each platform returns in mock mode, and the headers that force a failure.

A mock response mirrors the provider's protocol, so parsing, streaming and error handling are exercised end to end without contacting the provider or consuming quota.

Responses by platform

PlatformNon-streamingStreaming
OpenAI, DeepSeekA chat.completion bodychat.completion.chunk SSE events, terminated by data: [DONE]
ClaudeA /v1/messages bodyNamed SSE events: message_start, content_block_start, content_block_delta, content_block_stop, message_delta, message_stop
fal.ai (sync){ images: [{ url }] } or { video: { url } }SSE progress events, then the envelope
fal.ai (queue)Submit, status, result and cancel, with the returned URLs rewritten to the /falqueue prefixA status stream; status runs IN_QUEUE → IN_PROGRESS → COMPLETED
ByteDance SeedancePOST /contents/generations/tasks returns an id, and polling runs queued → running → succeeded, with the result at content.video_urlNot supported

Response content

The text a mock returns comes from the key's mock configuration, set when the key was created. The request body is never echoed.

SourceBehaviour
customThe configured text, returned verbatim
randomThe configured number of random tokens
assetAn image or video uploaded to storage, returned as an absolute URL on this gateway's origin (https://<gateway>/api/mock-asset/<key>), matching the absolute-storage-URL shape the vendors return

The model in a response is the one you sent — the mock neither guesses nor substitutes a model name (including for models that have not been released). A request without a model is rejected with 400 in the vendor's own error envelope, the same as the real API, rather than answered with a placeholder name.

Media type

Request pathMedia type
/chat/completionstext
/images/generationsimage
Anything elseThe key's media type

Simulated timing

Streaming and task responses are delayed to imitate the real thing:

StageDuration
Text: time to first token350 ms
Text: interval between tokens18 ms
fal queue and Ark task: queued800 ms
fal queue and Ark task: running2 000 ms

Headers that force a failure

HeaderValueEffect
x-mock-error100–599Returns that status with the platform's own error envelope
x-mock-drop1Cuts the stream mid-flight, without the terminating event
x-mock-drop0Never cuts the stream

Without x-mock-drop, a stream is cut mid-flight, so reconnect logic is exercised by default: a token stream truncates with a 6% chance, and a progress-reporting media stream rolls its own chance at each step.

force an error, or cut a stream
curl https://sluiceline.com/openai/chat/completions \
  -H "Authorization: Bearer $SLUICELINE_MOCK_KEY" \
  -H "x-mock-error: 429" \
  -H "Content-Type: application/json" \
  -d '{"model":"gpt-6-astra","messages":[{"role":"user","content":"hi"}]}'