Mock LLM API

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.

models

scenario catalogue

openai-compatible

chat completions and embeddings

anthropic-compatible

messages

The 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.

What you can practise here

Example request and response

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)

Open and run this endpoint

All 55 mock REST APIs

Use this response elsewhere

How this differs from local LLM mock servers

Last updated