This directory contains end-to-end tests for the OpenRouter SDK.
-
Install dependencies:
npm install
-
Set up your OpenRouter API key:
export OPENROUTER_API_KEY=your_api_key_hereOr create a
.envfile in the project root:OPENROUTER_API_KEY=your_api_key_here
Run all tests:
npm testRun only e2e tests:
npm run test:e2eRun tests in watch mode:
npm run test:watchThe e2e test suite includes:
- Fetching the list of available models
- Validating model properties
- Filtering models by category
- Getting the total count of models
-
Non-streaming mode:
- Sending chat requests and receiving responses
- Multi-turn conversations
- Token limit enforcement
-
Streaming mode:
- Streaming chat responses
- Progressive content delivery
- Finish reason detection
- Testing the beta responses endpoint
- Note: This endpoint is in alpha/beta and may require updates
- Tests make real API calls to OpenRouter, so you need a valid API key
- Tests may consume API credits
- Some tests use the
openai/gpt-3.5-turbomodel by default - The beta responses endpoint has limited test coverage as it's still in development