Using the ConnectRPC API
This page is for developers who call the Uno Kit API without a generated client. After you read it, you can send a call with curl or any HTTP library and read the result. The API reference lists every operation.
The Kit API is a set of ConnectRPC services in the uno.kit.v1 package. You can call each method as a plain HTTP request. No gRPC library is needed.
Send a call
Each call is an HTTP POST. The path has the form /rpc/<package>.<Service>/<Method>. The server is https://kit.uno.fun.
For example, the Pay method of AccountService is at:
https://kit.uno.fun/rpc/uno.kit.v1.AccountService/PaySend these headers:
| Header | Value | Notes |
|---|---|---|
content-type | application/json | The body is the request message as JSON. |
connect-protocol-version | 1 | Required by the Connect protocol. |
connect-timeout-ms | A number of milliseconds | Optional. Sets the call deadline. |
A call looks like this. Replace the method and the body with the operation you call:
curl -sS -X POST \
-H 'content-type: application/json' \
-H 'connect-protocol-version: 1' \
--data '{}' \
'https://kit.uno.fun/rpc/uno.kit.v1.AccountService/GetCapabilities'GetCapabilities takes an empty request and returns the limits the server enforces. The API reference describes the other operations and their fields. A method that needs a credential and does not get one returns an error.
Read the request and response
Requests and responses are JSON objects. Field names use camelCase, for example capacityBytes and idempotencyKey. A 64-bit integer field (int64) is a JSON string, for example "1073741824". Send and read these fields as strings.
A successful call returns HTTP 200 with the response message as JSON.
Handle errors
A failed call returns an error object with these fields:
| Field | Meaning |
|---|---|
code | A Connect status code such as invalid_argument, not_found, unauthenticated, permission_denied, resource_exhausted, failed_precondition or unavailable. |
message | A developer-facing English message. |
details | An optional array of typed details. |
Use code, not the message text, to decide what to do. The full list of codes is in the connect.error schema of the API reference.
Some methods answer with HTTP 402 and a payment challenge. See How Uno uses MPP for how to read and answer one.
Retry safely
Several methods that change state take an idempotencyKey field. Check each operation in the API reference for the field. For CreatePurchase, the same key and the same inputs return the same result. Changed inputs with the same key return invalid_argument. The page Agent mode and exit codes explains how the CLI derives its operation ids.
Next steps
- Browse the operations in the API reference.
- To pay for storage, read How Uno uses MPP.
- To avoid raw HTTP, use the uno CLI.