API reference · Keys
Claim a key with a connect code
POST/v1/key-pairings/claim
Creates a key from a one-time code made in Settings → API (Connect the CLI), with the public key of a key pair the caller made itself, so the private key never leaves the caller. The name, scopes, IP allowlist and expiry were chosen in Settings, after an electronic ID check. No signature needed: the code is the credential, used once, and valid for 10 minutes. Unknown, used and expired codes all answer not_found. Limited to 10 attempts an hour per IP address.
- Scope
- None. This endpoint needs no signature.
- Rate-limit class
- None (cached)
- Authentication
- None
Request body
application/json · ClaimKeyPairingRequest. Unknown fields are rejected.
codestringrequiredThe one-time code Settings → API shows after Connect the CLI. Valid for 10 minutes.
public_keystringrequiredThe new key's Ed25519 public key: the 32 bytes, base64url without padding.
clientobjectrequiredWhat is claiming the key, shown to the account holder in Settings → API.
4 properties
namestringrequiredversionstringrequiredhostnamestringoptionalosstringoptional
Responses
201 Created
The new key, and its account. application/json · Me
accountobject3 properties
typestring (enum)namestringtierstringThe account's fee tier.
keyobject6 properties
idstringnamestringscopesarray of string (enum)ip_allowlistarray of stringcreated_atstring (date-time)expires_atstring (date-time)nullablenull for a key without expiry.
Every response carries MK-Request-Id.
Errors
Errors use the error envelope. Match on code.
| Status | Code | Meaning |
|---|---|---|
| 400 | invalid_request | The request is malformed: bad JSON, an unknown or invalid field, or a missing header. |
| 403 | api_access_disabled | API access is switched off. |
| 404 | not_found | No such resource. |
| 413 | payload_too_large | The request body is larger than 8 KB. |
| 415 | unsupported_media_type | Request bodies must be application/json. |
| 422 | key_limit_reached | The account already has as many API keys as it can (5): revoke one in Settings → API first. |
| 429 | rate_limited | Too many requests. Wait for Retry-After seconds. |
| 500 | internal_error | Something went wrong on our side. |
| 503 | overloaded | The service is overloaded. Retry after Retry-After seconds. |
Request
curl https://public-api.myntkaup.is/v1/key-pairings/claimimport { Myntkaup } from "@myntkaup/api";
const client = new Myntkaup(); // reads the key from the environment
// The public half of a key pair you made; keep the private half.
const claimed = await client.claimKeyPairing({
code: "mkp_abcdefghijklmnopqrstuvwxyz",
publicKey: "11qYAYKxCrfVS_7TyWQHOg7hcvPapiMlrwIaaPcHURo",
client: { name: "my-tool", version: "1.0.0" },
});
console.log(claimed.key.id, claimed.key.scopes);from myntkaup import Myntkaup
client = Myntkaup() # reads the key from the environment
# The public half of a key pair you made; keep the private half.
claimed = client.claim_key_pairing(
code="mkp_abcdefghijklmnopqrstuvwxyz",
public_key="11qYAYKxCrfVS_7TyWQHOg7hcvPapiMlrwIaaPcHURo",
client={"name": "my-tool", "version": "1.0.0"},
)
print(claimed["key"]["id"], claimed["key"]["scopes"])Response
{
"account": {
"type": "person",
"name": "Jón Jónsson",
"tier": "tier-1"
},
"key": {
"id": "mk_live_4f9c2a7d1e0b8c6a5d3f",
"name": "DCA bot",
"scopes": [
"account:read",
"transactions:read"
],
"ip_allowlist": [
"203.0.113.10"
],
"created_at": "2026-11-01T09:30:00Z",
"expires_at": "2027-01-30T09:30:00Z"
}
}Base URL https://public-api.myntkaup.is