Generate a Client Library

Preczn is API-first. Generate a typed client in your own language from the OpenAPI specification.

Preczn does not publish a client library to install. The API is described by an OpenAPI specification instead, so you can generate a typed client for the language your platform already runs on — or skip the client entirely and call the API with an HTTP library.

Get the specification

The API Reference is the browsable form of the specification: every endpoint, request schema, and response schema is generated from it.

To generate a client you need the specification file itself. Ask your Preczn contact for the current OpenAPI document, and keep it in your repository alongside the generated code so you can see exactly which version your client was built from.

Generate a client

Point an OpenAPI generator at the file. OpenAPI Generator and Swagger Codegen each support more than 40 target languages.

npx @openapitools/openapi-generator-cli generate \
  -i ./preczn-api.json \
  -g typescript-axios \
  -o ./preczn-client
npx @openapitools/openapi-generator-cli generate \
  -i ./preczn-api.json \
  -g python \
  -o ./preczn-client
npx @openapitools/openapi-generator-cli generate \
  -i ./preczn-api.json \
  -g java \
  -o ./preczn-client

Swap the -g value for the generator that matches your stack — go, csharp, php, ruby, rust, kotlin, and others are available. npx @openapitools/openapi-generator-cli list prints the full set.

Authenticate the generated client with your platform's API keys, and remember that the key itself determines whether you are working against live or test data. See API Keys and Live vs Test Mode.

📘

Regenerate after the API changes

A generated client is a snapshot of the specification at the moment you ran the generator. Commit the generated code to your repository, and regenerate when you want to use an endpoint or field added since. Build your integration so that unrecognized response fields are ignored rather than treated as errors.

Why Preczn doesn't publish one

Preczn is a server-side HTTPS API, and the platforms integrating it are written in every language. A maintained library would cover a handful of those languages, add a dependency to your build, and trail the API it wraps. Generating from the specification gives you idiomatic types in your own language, on your own release schedule, with nothing to wait for when the API gains a capability.

It is also entirely reasonable to skip the client. A pair of API keys and an HTTP library is a complete integration, and many platforms never generate anything.

🚀

Building with an AI coding assistant?

The Preczn MCP Server gives Claude Code, Cursor, Copilot, and other MCP-aware tools direct access to this documentation and the API reference — useful whether you are writing calls by hand or reviewing generated code.


Did this page help you?