SDKs and HTTP clients
Backwork has no published SDKs yet. Call the REST API with your language's HTTP client, or generate a typed client from the OpenAPI document.
Backwork does not publish SDKs yet. There is no Backwork package on PyPI, RubyGems or NuGet. The @backwork/api name on npm is an empty 0.0.0 placeholder, so do not install it.
The API is plain JSON over HTTPS, so any HTTP client works. You can also generate a typed client from the OpenAPI document.
Call the API directly
Every request needs a live key in the Authorization header. Create one with your organization's free starter credits. The examples read it from BACKWORK_API_KEY:
export BACKWORK_API_KEY=bwk_live_YOUR_API_KEYEach example looks up CPT code 99213 with GET /api/v1/codes/lookup. It prints the code, its code system and whether Backwork found it. If the call fails, it prints the error code and message. A success response wraps the result in data; an error response has success: false and an error object. See Errors.
curl "https://backworkhealth.com/api/v1/codes/lookup?code=99213" \
-H "Authorization: Bearer $BACKWORK_API_KEY"The API reference lists every endpoint, parameter and response field. Before you retry a failed call, check its retryable flag and the rate limits.
Generate a client
The OpenAPI 3.1 document at https://backworkhealth.com/openapi.json describes every /api/v1 endpoint. Generate a client from it and regenerate when the document changes.
TypeScript: openapi-typescript
openapi-typescript turns the document into types, and openapi-fetch makes typed calls with them:
npm install openapi-fetch
npx openapi-typescript https://backworkhealth.com/openapi.json -o backwork.d.tsimport createClient from "openapi-fetch";
import type { paths } from "./backwork.d.ts";
const backwork = createClient<paths>({
baseUrl: "https://backworkhealth.com/api/v1",
headers: { Authorization: `Bearer ${process.env.BACKWORK_API_KEY}` },
});
const { data, error } = await backwork.GET("/codes/lookup", { params: { query: { code: "99213" } } });
if (data) console.log(data.data.code, data.data.code_system, data.data.found);
else console.log(error.error.code, error.error.message);Other languages: OpenAPI Generator
OpenAPI Generator reads the document and emits clients for Python, Ruby, Go, C#, Java and many more:
docker run --rm -v "$PWD:/local" openapitools/openapi-generator-cli:v7.12.0 generate \
-i https://backworkhealth.com/openapi.json \
-g python \
-o /local/backwork-clientSwap -g python for ruby, go, csharp or java. Generated method names follow each endpoint's operationId, such as lookupCode.
Test the generated client before you rely on it
The generated Python client rejects every successful response: it reads success: true as a string enum. The generated Go client does not compile. For those languages, use the direct HTTP examples above until Backwork publishes SDKs.
Command line
The Backwork CLI is a single Go binary for lookups from a terminal or a script.
Use Backwork from an AI assistant
The MCP server connects Claude and other MCP clients to Backwork with no code.
Last updated on