Skip to content

API Keys

This page provides a brief overview on how to use a KoinosPro API to interact with the Koinos API.

To get started, you'll need to obtain an API key from the KoinosPro site. This key will be included in the header or URL of your API requests, authorizing your calls to the Koinos API.

To generate a new API key, login to KoinosPro and select, "API Keys". Any keys you have already generated will be listed. If you do not see any, click, "Generate API Key" and a new API key will be generated for you. All API keys generated under your account are tied to the same restrictions and share usage. The purpose of allowing the creation of multiple API keys is for security.

JSON-RPC

To make a JSON-RPC call, include the API key in the request header under the key apikey or in the request URL directly.

curl -H 'apikey: 123456' -d '{"jsonrpc":"2.0", "method":"chain.get_head_info", "id":0}' https://api.koinos.pro/jsonrpc
curl -d '{"jsonrpc":"2.0", "method":"chain.get_head_info", "id":0}' https://api.koinos.pro/jsonrpc\?apikey=123456

gRPC

To make a gRPC call, include the API key in the header of your request, similar to the JSON-RPC call.

While Koinos does support gRPC, it does not yet support gRPC reflection. Because of that, you will need the koinos_descriptors.pb file, which can be obtained on GitHub.

In our example, we will be using grpcurl. Your use will look different depending on which language library you use.

grpcurl -protoset koinos_descriptors.pb -H 'apikey: 123456' grpc.koinos.pro:443 koinos.services.koinos/get_head_info

Koinos CLI

In order to use your API key in the Koinos CLI, you need to set it as a URL endpoint in the .koinosrc config file.

Change the connect command to the authenticated URL:

connect https://api.koinos.pro/jsonrpc?apikey=123456

Kondor

To use the API key in Kondor, right click the extension icon and select, "Options".

Then add the authenticated URL under, "RPC Nodes".

https://api.koinos.pro/jsonrpc?apikey=123456