Test LLM integrations without a real key or bill: chat completions and messages in the familiar shapes, SSE streaming, tool calls, JSON mode, and 429/500/overloaded/timeout/cut-stream failures chosen by model name.
Base URL: https://funapi.dev/api/llm/v1 · 5 endpoints · OpenAPI 3.1 spec and Postman collection available. New here? Read the getting started guide.
scenario catalogue
GET /llm/v1/models — List mock models — each name selects a scenario · Responds with 200 Link to this endpointGET /llm/v1/models/{model} — Describe one mock model · Responds with 200 404 Link to this endpointchat completions and embeddings
POST /llm/v1/chat/completions — Chat Completions shape: streaming (SSE), tools, JSON mode, failures by model · Responds with 200 400 401 404 429 500 503 Link to this endpointPOST /llm/v1/embeddings — Deterministic 8-dimension embeddings (same text → same vector) · Responds with 200 400 401 Link to this endpointmessages
POST /llm/v1/messages — Messages shape: content blocks, tool_use, SSE events, failures by model · Responds with 200 400 401 404 429 500 Link to this endpointThe Mock LLM API lets you test code that calls a language model without a real key, a bill or a non-deterministic answer. It speaks the request and response shapes of the OpenAI Chat Completions and Anthropic Messages APIs, including server-sent event streaming and tool calls, and the model name picks the scenario: mock-429 is rate limited, mock-503 is overloaded, mock-stream-cut drops the stream halfway, mock-malformed-json returns a body that will not parse.
GET https://funapi.dev/api/llm/v1/models — List mock models — each name selects a scenario. No token, no signup:
curl -i https://funapi.dev/api/llm/v1/models
Response: 200 OK
{
"object": "list",
"data": [
{
"id": "mock-echo",
"object": "model",
"created": 1767225600,
"owned_by": "funapi",
"description": "Replies by quoting your last message. Deterministic."
},
{
"id": "mock-json",
"object": "model",
"created": 1767225600,
"owned_by": "funapi",
"description": "Replies with a JSON object as the message text (use with JSON mode)."
},
{
"id": "mock-tool-call",
"object": "model",
"created": 1767225600,
"owned_by": "funapi",
"description": "Calls the first tool you declare with arguments built from its schema, then answers from the tool result."
},
{
"id": "mock-length",
"object": "model",
"created": 1767225600,
"owned_by": "funapi",
"description": "Stops early with finish_reason / stop_reason \"length\" / \"max_tokens\"."
},
{
"id": "mock-content-filter",
"object": "model",
"created": 1767225600,
"owned_by": "funapi",
(truncated — the full response comes back when you run it)
How this differs from local LLM mock servers
Last updated