SDKs / Overview
SDKs
Official Pantech libraries for Go, Python and JavaScript. They handle keys, retries, idempotency, pagination and waiting for you.
The SDKs call the public API for you. You write create an instance; they add the headers, retry safely, follow pages and wait for the change to finish.
| Language | Install | Import |
|---|---|---|
| Go | go get github.com/Pantech-Dynamics/pantech-go | github.com/Pantech-Dynamics/pantech-go (package pantech) |
| Python | pip install pantech | import pantech |
| JavaScript and TypeScript | npm install @pantechdynamics/sdk | import { Pantech } from "@pantechdynamics/sdk" |
What every SDK does
- Reads your key from
PANTECH_API_KEY. Or pass it in. Make one under API keys. - Talks to
https://api.pantechdynamics.com/public/v1. SetPANTECH_API_URL, or pass a base URL, to use another. - Adds an
Idempotency-Keyto every change. A fresh UUID per call, reused on each retry, so a retry never does the work twice. Why it matters. - Retries what is safe to retry. Network errors and timeouts,
429(afterRetry-After),500,502,503and504, up to 3 times with a growing, random wait. The few calls the API does not replay, such as adding or deleting an SSH key, opening an instance console, or a webhook's test, delete, rotate-secret and redeliver, are sent once, and retried only after a429, which means the API did not run them. - Turns errors into one error type with the HTTP status, the stable
code, the title, the detail, therequest_idand any field errors. Error codes. - Follows pages for you. Loop over every item; the SDK follows
next_cursor. - Waits for changes.
operations.waitpolls an operation until it finishes, and raises an error if it failed. New machines and databases are waited on through their order. - Verifies webhooks. Checks the
Pantech-Signatureheader on a delivery. How.
Every SDK covers every endpoint in the API reference.
Which one to use
Use the language your project already uses. All three do the same things. If you only need a few calls from a shell script, the CLI may be simpler. To let an AI app manage your servers, see Connect your AI.