Authentication#
If you use Agentic Wallet#
Agentic Wallet supports two authentication methods:
Create or access your wallet with just an email — no developer account or API key required. Ideal for getting started quickly.
- 1Talk to your Agentplaintext
Log in to Agentic Wallet with email - 2Enter your emailplaintext
<email> - 3Enter the verification codeplaintext
<otp-code>
If you use Open API#
You can also authenticate using an API Key for Onchain OS Skills/Open API. You'll need to create a project and generate an API key in the developer management portal first. For detailed steps and resources, refer to here.
All API requests must include the following headers for authentication:
- OK-ACCESS-KEY: API key
- OK-ACCESS-TIMESTAMP: Request timestamp (UTC), in ISO format, e.g. 2020-12-08T09:08:57.715Z
- OK-ACCESS-PASSPHRASE: The passphrase specified when creating the API key
- OK-ACCESS-SIGN: Signature
Signing steps:
- 1Concatenate pre-hash stringConcatenate timestamp, method, requestPath, and body into a single string.
- 2HMAC SHA256 signatureSign the pre-hash string with the secret key (generated when creating the API key).
- 3Base64 encodeEncode the signature result using Base64.
Postman is a popular API development and testing tool that allows developers to design, test, and document APIs. It provides a user-friendly graphical interface for sending HTTP requests to APIs.
If you haven't installed Postman yet, you can download it for free from the Postman website: https://www.postman.com/
- 1Add Parameters
This typically applies to GET requests. If your request requires query parameters, you can add them as key-value pairs under the Params tab.
- 2Set Headers
Under the Headers tab, add the following key-value pairs:
OK-ACCESS-KEYOK-ACCESS-PASSPHRASE
- 3Add Body
This typically applies to POST requests. If your request requires a request body, you can add it under the Body tab:
- Select raw and JSON from the dropdown menu
- Enter your request body in JSON format
- 4Set Pre-request Script
Used to generate the required signature (
OK-ACCESS-SIGN) and timestamp (OK-ACCESS-TIMESTAMP). Under the Pre-request Script tab, insert the script corresponding to your request type (GET requests exclude the request body; edit the secret key as needed).GET request:
javascriptvar method = pm.request.method; var now = new Date(); var isoString = now.toISOString(); var path = pm.request.url.getPathWithQuery(); var sign = CryptoJS.enc.Base64.stringify( CryptoJS.HmacSHA256( isoString + method + path, pm.variables.replaceIn('{{secret_key}}') ) ); pm.request.headers.add({ key: 'OK-ACCESS-SIGN', value: sign, }); pm.request.headers.add({ key: 'OK-ACCESS-TIMESTAMP', value: isoString, });POST request:
javascriptvar method = pm.request.method; var now = new Date(); var isoString = now.toISOString(); var path = pm.request.url.getPathWithQuery(); var bodyStr = pm.request.body.raw; var sign = CryptoJS.enc.Base64.stringify( CryptoJS.HmacSHA256( isoString + method + path + bodyStr, pm.variables.replaceIn('{{secret_key}}') ) ); pm.request.headers.add({ key: 'OK-ACCESS-SIGN', value: sign, }); pm.request.headers.add({ key: 'OK-ACCESS-TIMESTAMP', value: isoString, });