This quickstart walks through creating an API key, setting up the Prime Go SDK, and making your first few API calls.
Initial Setup
- Create a Coinbase Prime Account: Sign up at Coinbase Prime.
- Generate an API Key: From the web UI, navigate to Settings -> APIs.
- Authenticate: Ensure you authenticate all API requests. Detailed guidance is available at API Authentication.
REST API URL:https://api.prime.coinbase.com/v1
Using the Prime SDKs
-  Java 
-  .NET 
-  Go 
-  Python 
-  TypeScript 
Installation
The Coinbase Prime Java SDK supports Java versions 11+.Check your Java version:Install the Maven Dependency
<dependency>
    <groupId>com.coinbase.prime</groupId>
    <artifactId>coinbase-prime-sdk-java</artifactId>
   <version>1.0.0</version>
</dependency>
Making your first API call
Initialize Prime Client
The following code snippet demonstrates how to initialize the Prime client.package com.coinbase.examples;
import com.coinbase.prime.client.CoinbasePrimeClient;
import com.coinbase.prime.credentials.CoinbasePrimeCredentials;
import com.fasterxml.jackson.databind.ObjectMapper;
public class Main {
    public static void main(String[] args) {
        String credsStringBlob = System.getenv("COINBASE_PRIME_CREDENTIALS");
        ObjectMapper mapper = new ObjectMapper();
        CoinbasePrimeCredentials credentials = new CoinbasePrimeCredentials(credsStringBlob);
        CoinbasePrimeClient client = new CoinbasePrimeClient(credentials);
    }
}
Listing Portfolios
Update the code snippet with the service invocation and call to make your first API call with Prime to List Portfolios.package com.coinbase.examples;
import com.coinbase.prime.client.CoinbasePrimeClient;
import com.coinbase.prime.credentials.CoinbasePrimeCredentials;
import com.coinbase.prime.factory.PrimeServiceFactory;
import com.coinbase.prime.model.portfolios.ListPortfoliosResponse;
import com.coinbase.prime.portfolios.PortfoliosService;
import com.fasterxml.jackson.databind.ObjectMapper;
public class Main {
    public static void main(String[] args) {
        String credsStringBlob = System.getenv("COINBASE_PRIME_CREDENTIALS");
        ObjectMapper mapper = new ObjectMapper();
        CoinbasePrimeCredentials credentials = new CoinbasePrimeCredentials(credsStringBlob);
        CoinbasePrimeClient client = new CoinbasePrimeClient(credentials);
        PortfoliosService portfoliosService = PrimeServiceFactory.createPortfoliosService(client);
        ListPortfoliosResponse listPortfoliosResponse = portfoliosService.listPortfolios();
        System.out.println(mapper.writeValueAsString(listPortfoliosResponse));
    }
}