Python, TypeScript and Go clients, coming soon

Built and tested, not published. The install commands and quickstarts below are the launch versions; until then the plain HTTP API works from any language.

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.

LanguagePackageInstall (at launch)Needs
Pythononekeypip install onekeyPython 3.9+, sync and async
TypeScript / JavaScriptonekeynpm install onekeyNode 18+, or anything with fetch
Goonekey-gogo get github.com/onekey-hq/onekey-goGo 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.

python
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)
typescript
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);
go
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#

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.