Generate a client
There are no hand-maintained client libraries. The API is described by an OpenAPI 3.1 document, and you generate a client for whatever language you are working in directly from it.
That document is the same one the API reference renders, and it lives beside the server that implements it, so a generated client tracks the real API rather than a separately maintained copy of it.
https://crsdk.github.io/alpha-sdk-api/api-reference/openapi.yamlGenerate
Section titled “Generate”Point any OpenAPI generator at the specification. A few common ones:
npx @hey-api/openapi-ts \ -i https://crsdk.github.io/alpha-sdk-api/api-reference/openapi.yaml \ -o src/camera-clientpip install openapi-python-clientopenapi-python-client generate \ --url https://crsdk.github.io/alpha-sdk-api/api-reference/openapi.yaml# Add the Swift OpenAPI Generator plugin to Package.swift, then place the# specification at Sources/<Target>/openapi.yaml and build.swift package plugin --allow-writing-to-package-directory generate-code-from-openapi# openapi-generator supports ~50 languages; swap the generator name.npx @openapitools/openapi-generator-cli generate \ -i https://crsdk.github.io/alpha-sdk-api/api-reference/openapi.yaml \ -g go \ -o ./camera-clientPin the specification file into your repository rather than fetching it at build time if you want reproducible builds — it is a single YAML file.
What the API looks like
Section titled “What the API looks like”The operations are grouped by tag, and a generated client will mirror that grouping:
server health, status, logscameras list, connect, disconnect, getConnectionStatusproperties get, set, getAll, getPriorityKey, setPriorityKeyactions shutter, halfPress, afShutter, zoom, focusNearFar, movieRecliveView enable, disable, getStatus, start, stop, getFramesdCard list, download, downloadThumbnail, downloadScreennailsettings download, upload, list, importLutTwo things sit outside what a generator will give you, because they are not plain request/response operations:
- Server-Sent Events — the two event streams are long-lived and most
generators will not produce anything usable for them. Consume them with native
EventSource(browser),URLSession.bytes(for:)(Swift), orhttpx.stream(Python). See the SSE recipe. - Discovery, reconnect and lifecycle handling — application concerns rather than API surface. The recipes below cover the usual patterns.
Running the server
Section titled “Running the server”Every client, generated or not, talks to the REST server running on the machine the camera is attached to.
Recipes
Section titled “Recipes”Patterns that sit outside generated code. Each works against the REST API directly, so they apply whatever language you generate for.