AI & LLM
OpenAI mock API
Stateful OpenAI API replica: models, chat completions (tools, stored completions, streaming body), responses, embeddings, files, batches, moderations and signed Standard Webhooks events.
At a glance
- Operations
- 388
- Stateful operations
- 19
- Stateful resources
- 7
- Webhook events
- 3
- Vendor API version
- 2.3.0
- Verification
- Spec-verified
How it works
Use OpenAI without calling OpenAI OpCo, LLC
- Install the mock from the library into a workspace. It runs as a virtual service.
- Point your client's base URL at the virtual service instead of the vendor.
- Authenticate the way you already do. The mock accepts the same credential shape:
Authorization: Bearer sk-MockApiKey0123456789 State
Resources that remember
Writes persist per caller, so a create followed by a read returns what you created.
| Resource | Operations |
|---|---|
| Models | 2 |
| Chat completions | 4 |
| Responses | 3 |
| Embeddings | 1 |
| Files | 5 |
| Batches | 4 |
| Moderations | 1 |
Webhooks
Events your handlers can receive
- response.completed
- batch.cancelled
- batch.completed
Deliveries are signed with the svix scheme, so your verification code runs unchanged.
Coverage
388 operations
19 of them are stateful. The largest groups:
| Group | Operations |
|---|---|
| Other operations | 368 |
| Files | 5 |
| Batches | 4 |
| Chat completions | 4 |
| Responses | 3 |
| Models | 2 |
Verification
Spec-verified
Generated operations are checked against the vendor OpenAPI description, which proves shape and routing. Stateful operations and scenario suites prove behaviour. Responses are not yet compared with a live vendor sandbox.
1 operations cannot be checked against the specification.
Source and limits
License, source and limits
- Generated from the OpenAI OpCo, LLC API description, licensed under MIT.
- OpenAI OpCo, LLC API documentation
- Source specification
Each collection holds up to 1 MiB of objects per API key; writes beyond that are dropped (x-maxoperf-vs-state: capacity). Only the listed resources are stateful; the many other (incl. beta) operations answer with schema-valid stateless responses. Chat completions are deterministic mock replies ("Mock reply to: <last user message>", echoed in full, not truncated), usage is derived from character counts, and stream:true is rendered as one text/event-stream body (data: chunks then data: [DONE]) without timed chunks. Embeddings are constant unit vectors (1536 dims for text-embedding-3-small, 3072 for -large). File uploads above 1 MiB are rejected by the runtime with 413 (VS_MAX_BODY_BYTES) and file content downloads are a stub. Batches and background responses advance by elapsed time and send signed Standard Webhooks events (response.completed, batch.completed, batch.cancelled). Eval operations answer with fixed, schema-valid sample bodies (read-only). Unknown models answer 404 model_not_found except the literal id "string" (the stand-in id of spec-sampled requests). A batch cancelled before it completes still emits batch.completed after its delay. No real model inference or rate limiting.
MaxoPerf is not affiliated with, endorsed by, or sponsored by OpenAI OpCo, LLC. OpenAI is a trademark of its owner.