1. Create An API Key
Sign in to PubFi, open Manage application keys, and create a key. Copy it when shown. Store it in your local secret manager or environment asPUBFI_API_KEY.
Do not put the key in source code, chat messages, or logs.
This guide uses Production at https://api.pubfi.ai. For Staging, use a separate key created at
https://stg.pubfi.ai and the API root https://api-stg.pubfi.ai. See the
Staging guide.
2. Confirm The Free Example Is Available
The example API is Subscan current time. It needs no address or request body; other providers use the same PubFi authentication and access-selection rules. Before running it, open the API Reference and findGET /v1/gateway/subscan/api/now. Confirm that the operation advertises
x-pubfi-free-variant with suffix :free. If it is absent, do not run this example or remove
its suffix to try a paid request. See Use The PubFi Gateway
to select another advertised free operation.
The API Reference describes the installed routes. This example does not guarantee that the
route is available in every environment or future release.
3. Make The Request
WithPUBFI_API_KEY loaded in your environment, run:
200, a JSON provider response, and x-pubfi-request-id.
The timestamp changes between calls. PubFi returns the provider body without adding a success
wrapper. Check the provider’s business result as well as the HTTP status.
The :free suffix selects free execution. It still requires your PubFi API key. The advertised
rate and quota limits are shared by the account as specified by the selected route. A paid
operation’s pricing_unavailable value does not disable a separately advertised free variant.
4. Call The API You Need
Search the API Reference for your operation. Use its exact method, path parameters, query parameters, and JSON body. For a free call, confirm the advertisement and append:free to the final path segment. Use Authorization: Bearer with your PubFi key.
If the path includes {network}, select its documented alias before calling it. See
network selection for the shared rule
and the relevant provider page for provider-specific choices.
If a request schema is empty or only says string / binary, it does not describe the provider’s
JSON fields. Consult the exact upstream operation documentation or report the missing schema.
Do not invent parameters. See API Reference for schema limits.
If The Request Fails
When requesting help, include the method, path, redacted request body, status, error code, and
x-pubfi-request-id. Omit the key and private account data.
Next Steps
- Subscan: network selection, rewards, and transfers.
- Use The PubFi Gateway: discovery, POST bodies, and free or paid requests.
- API Key And Runtime: account access and quotas.
- MCP Client Setup: connect an agent.
- Accountless x402: use a separately eligible payment flow.