← all adapters
llm-style
simulates OpenAI API + Anthropic API OpenAI v1 / Anthropic v1
restadapter v0.1.03 routes
verification
use it
# add to stunt.yaml
services:
llm:
adapter: embedded:llm-style
# then
$ stunt upThe embedded: source extracts this adapter from the binary — no git clone, fully offline.
how to mock the OpenAI API + Anthropic API locally
Install stunt, paste the service block above into stunt.yaml, run stunt up — then point your client at localhost instead of OpenAI API + Anthropic API. It works offline, keeps state across requests and restarts, and every response is synthetic: the route shapes, status codes, pagination, and webhook delivery follow the real OpenAI API + Anthropic API OpenAI v1 / Anthropic v1 surface — the data is fake, the behavior is real.
api surface (3)
generated from the adapter manifest — exactly what boots, nothing more · covers 0% of the real API's 246 routes (derived from sdk openai-node @ 7.5.0 (floor))
3 routes
POST/v1/chat/completions
GET/v1/models
POST/v1/messages
SDK-verified behaviors (2)
- ✓models.list returns the catalog
- ✓chat.completions.create returns a typed echo response
Not implemented (4)
- No embeddings (POST /v1/embeddings) or legacy completions endpoints
- No Anthropic SSE streaming (stream:true only handled for OpenAI)
- No tool use, function calling, or JSON mode
- No image or multimodal content blocks
Differs from the real API (3)
- Responses deterministic: echo of the last user message; no model or randomness
- Reply derived solely from the last user message; earlier history ignored
- stream:true (OpenAI) returns one SSE chunk plus [DONE], not token-by-token
want more of the OpenAI API + Anthropic API surface? adapters are YAML + Starlark — the authoring guide covers adding routes, fixtures, and state machines. Open an issue for anything big first, or just file a PR — merged routes ship in the next release.