ai.v1.AssistantService
PrepareAssistantKeys
PrepareAssistantKeys starts setting up the keys the assistant acts with: it generates one Ed25519 key pair per account, keeps the private keys, and returns the public keys with their registration proofs and deadline. Then register them, with the policy of each account, in one SetAssistantKeys request with a fresh step-up proof before the deadline, and call CompleteAssistantKeys. The step-up proof goes to SetAssistantKeys only, never to the assistant. A setup replaces no key until it is registered. Errors: - INVALID_ARGUMENT: malformed request, or an account named twice. - RESOURCE_EXHAUSTED: USAGE_LIMIT_REACHED; too many setups are pending. Complete one or wait until it expires. - UNAVAILABLE: SERVICE_UNAVAILABLE; retry the request. - UNAUTHENTICATED: missing or invalid credentials.
Request
curl --request POST \ \
--url 'https://api.testnet.polyester.com/ai.v1.AssistantService/PrepareAssistantKeys' \
--header 'Content-Type: application/json' \
--header 'Connect-Protocol-Version: 1' \
--data '{
"accounts": [
{
"subaccountId": "6789012345678"
}
]
}'Responses
{
"expiresAt": "2025-01-01T00:00:00Z",
"keys": [
{
"publicKeyEd25519": "AA==",
"registrationDeadline": "2025-01-01T00:00:00Z",
"registrationProof": "AA==",
"subaccountId": "6789012345678"
}
],
"setupId": "1"
}ai.v1.PrepareAssistantKeysRequestai.v1.PrepareAssistantKeysResponse1 to 64 accounts, each at most once.
The setup, the argument of CompleteAssistantKeys.
Subaccount the key is for. Omitted for the main account. Public ID. ConnectRPC carries it as fixed64 (a decimal string in JSON).
Ed25519 public key, 32 bytes. Register it as the account's assistant key with SetAssistantKeys.
The key's registration proof (64 bytes). Pass it unchanged as the key's registration_proof in SetAssistantKeys.
The key's registration deadline. Pass it unchanged as the key's registration_deadline in SetAssistantKeys; the key cannot be registered after it.
The keys' registration deadline: register them with SetAssistantKeys before this time. After it, they cannot be registered.
| Key | HTTP status | Connect code | Error | When |
|---|---|---|---|---|
| unauthenticated | 401 | unauthenticated | Unauthenticated | Authentication required. |
| permission-denied | 403 | permission_denied | Permission Denied | Permission denied. |
| invalid-argument | 400 | invalid_argument | Invalid Argument | Invalid argument. |
| not-found | 404 | not_found | Not Found | Not found. |
| unavailable | 503 | unavailable | Unavailable | Service unavailable. |