← Back to compatibility guides

Anthropic Messages compatibility

Anthropic Messages API mocking for CI/CD

Exercise Claude-compatible message flows with deterministic success, refusal, timeout, and rate-limit fixtures.

Copy-paste SDK setup

Use this in local tests, GitHub Actions, or pre-deploy smoke suites.

const anthropic = new Anthropic({
  apiKey: process.env.MOCKLLM_API_KEY,
  baseURL: 'https://api.mockllm.io'
})

Endpoint

/v1/messages

CI use cases

  • Claude Messages API regression tests
  • Tool-use response shape checks
  • Provider failover drills

GitHub Actions smoke test

Gate releases with a deterministic MockLLM fixture instead of a live provider call.

- name: Anthropic Messages MockLLM smoke test
  env:
    MOCKLLM_API_KEY: ${{ secrets.MOCKLLM_API_KEY }}
  run: npm test -- --runTestsByPath tests/anthropic-messages-smoke.test.ts

Ship deterministic LLM tests this week

Start with one fixture, prove the provider contract, and expand coverage without increasing API spend.