← Back to compatibility guides
OpenAI compatibility
OpenAI API mocking for CI/CD
Drop-in baseURL swap for OpenAI SDKs so teams can test chat completions without live-token spend or flaky model output.
Copy-paste SDK setup
Use this in local tests, GitHub Actions, or pre-deploy smoke suites.
const client = new OpenAI({
apiKey: process.env.MOCKLLM_API_KEY,
baseURL: 'https://api.mockllm.io/v1'
})Endpoint
https://api.mockllm.io/v1
CI use cases
- ✓Chat completion contract tests
- ✓Rate-limit and timeout fallback tests
- ✓Fixture-backed pull request checks
GitHub Actions smoke test
Gate releases with a deterministic MockLLM fixture instead of a live provider call.
- name: OpenAI MockLLM smoke test
env:
MOCKLLM_API_KEY: ${{ secrets.MOCKLLM_API_KEY }}
run: npm test -- --runTestsByPath tests/openai-smoke.test.tsShip deterministic LLM tests this week
Start with one fixture, prove the provider contract, and expand coverage without increasing API spend.