Copyable examples for TokenLab native endpoint families beyond generic OpenAI-compatible chat.
cp .env.example .env
export TOKENLAB_API_KEY=sk-your-tokenlab-key
npm install
npm testexamples/chat-completions.mjsexamples/responses.mjsexamples/anthropic-messages.mjsexamples/gemini-generate-content.mjsexamples/list-models.mjsexamples/systemone.mjs— synchronous Jev typed decisions; checks the public operation contract before a billable request. RequiresTOKENLAB_API_KEY. It preserves answers/usage and never executes the classified action.
npm run verify:contract checks the live OpenAPI document for Chat Completions, Responses, Anthropic Messages, Gemini generateContent, System One decisions, and model discovery, then verifies the example model IDs against the public catalog. This check makes no paid inference calls. GitHub Actions repeats it daily.
Use the public contract check in another repository:
steps:
- uses: hedging8563/tokenlab-native-endpoints-examples@v1.1.0
with:
models: gpt-5.5,claude-sonnet-5models is optional. It accepts comma-separated TokenLab logical model IDs and defaults to the model IDs used by this repository's examples. The OpenAPI document and public model catalog URLs are fixed by the action.
Version v1.1.0 adds the native System One endpoint and Jev to the default contract check. The historical v1 tag is unchanged; pin v1.1.0 to use the updated checks.
- TokenLab docs: https://tokenlab.sh/docs
- API formats: https://tokenlab.sh/docs/en/guides/api-formats
- Model catalog: https://api.tokenlab.sh/v1/models