Skip to main content

Generate a Typed Telemetr.io API Client

Use the downloadable OpenAPI document that matches this reference. Save a copy with your integration so that regeneration is reviewable.

Generate with Docker

curl --fail --location "https://api.tlmtr.io/generated-api/openapi.json" -o openapi.json

docker run --rm -v "$PWD:/local" openapitools/openapi-generator-cli generate \
-i /local/openapi.json -g typescript-fetch -o /local/telemetrio-client

Change the generator to python, php, go, rust, java or another supported generator for your language. For repeatable builds, pin the generator image to the version verified by your project.

The Node wrapper is another option, but its standard local execution requires a Java runtime:

npx @openapitools/openapi-generator-cli generate \
-i openapi.json -g typescript-fetch -o telemetrio-client

Configure and verify

Set the client's API base URL and the api_key security scheme, which sends x-api-key. Generated class and method names depend on your chosen generator; use the generated client's README and types rather than assuming names from a different language.

Before using the client with an account, inspect the generated request for GET /v1/usage/info and verify that it sends the header to the intended environment. Keep credentials on the backend.

Verify that your client supports key_type, structured 402/426 responses and both pagination styles. An HTTP client retry policy is not a guarantee that repeated creation requests are deduplicated.