What they will be#
Thin, typed wrappers over the same HTTP API. They read your key from ONEKEY_KEY, retry safely, tell you what every call cost, and give typed methods for the most-used platforms while a generic request call reaches every endpoint, including ones added later.
| Language | Package | Install (at launch) | Needs |
|---|---|---|---|
| Python | onekey | pip install onekey | Python 3.9+, sync and async |
| TypeScript / JavaScript | onekey | npm install onekey | Node 18+, or anything with fetch |
| Go | onekey-go | go get github.com/onekey-hq/onekey-go | Go 1.21+, standard library only |
Quickstart at launch#
Each snippet looks up a GitHub profile (1 credit) and prints the data and what the call cost.
from onekey import Onekey
client = Onekey() # reads ONEKEY_KEY
env = client.github.profile(username="torvalds")
print(env.data)
print(env.meta.credits_charged, env.meta.cached)import { Onekey } from "onekey";
const client = new Onekey(); // reads ONEKEY_KEY
const env = await client.github.profile({ username: "torvalds" });
console.log(env.data);
console.log(env.meta.creditsCharged, env.meta.cached);c, err := onekey.New() // reads ONEKEY_KEY
if err != nil { log.Fatal(err) }
env, err := c.Github.Profile(ctx, &onekey.GithubProfileParams{Username: "torvalds"})
if err != nil { log.Fatal(err) }
fmt.Println(string(env.Data))
fmt.Println(env.Meta.CreditsCharged, env.Meta.Cached)What is designed in#
- Retries: timeouts, network errors,
429and5xxup to 2 times with backoff and jitter, honouringRetry-After. Never400,401,402,403,404or422. - Typed errors that carry the error code, HTTP status and request id.
- Pagination helpers that follow a cursor with a page limit you set. Each page is charged like a normal call.
- Free catalog helpers for platforms, categories and your balance.
- The key is sent only in the
x-api-keyheader, never in a URL.
Call Onekey from your server: in a browser, anything you ship, including the key, is public.
Until the libraries are published#
Use the HTTP API directly. It is a few lines in any language; every endpoint page has curl, Python and JavaScript snippets, and /openapi.json lets you generate a client. Working with an AI tool instead? See the MCP server. The full reference is SDKs in the docs.