Skip to content

Cartridge RPC

Cartridge provides dedicated RPC endpoints for Starknet networks with built-in authentication and CORS support.

Pricing

Cartridge RPC is free for up to 1m requests per month. Additional requests are charged at $5/1m requests to the related slot team.

Endpoints

Mainnet

https://api.cartridge.gg/x/starknet/mainnet

Sepolia Testnet

https://api.cartridge.gg/x/starknet/sepolia

Authentication

Cartridge RPC supports two authentication methods:

API Token Authentication

Authenticate requests using an API token with the Authorization header:

curl https://api.cartridge.gg/x/starknet/mainnet \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "starknet_chainId",
    "params": [],
    "id": 1
  }'

Domain Whitelisting

For browser-based applications, whitelist your domains to make direct RPC calls without exposing API tokens. Once configured, your whitelisted domains can make requests directly:

const response = await fetch('https://api.cartridge.gg/x/starknet/mainnet', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    jsonrpc: '2.0',
    method: 'starknet_chainId',
    params: [],
    id: 1,
  }),
});

Setup with Slot CLI

Prerequisites

Authenticate with Cartridge:

slot auth login

Managing API Tokens

Create a new RPC API token:

slot rpc tokens create <KEY_NAME> --team <TEAM_NAME>

List all RPC API tokens:

slot rpc tokens list --team <TEAM_NAME>

Delete an RPC API token:

slot rpc tokens delete <KEY_ID> --team <TEAM_NAME>

Managing CORS Whitelist

Add a domain to the CORS whitelist:

slot rpc whitelist add <DOMAIN> --team <TEAM_NAME>

Examples:

# Whitelist a specific domain
slot rpc whitelist add example.com --team my-team
 
# Wildcard patterns are supported
slot rpc whitelist add *.example.com --team my-team

List all whitelisted domains:

slot rpc whitelist list --team <TEAM_NAME>

Remove a domain from the CORS whitelist:

slot rpc whitelist remove <ENTRY_ID> --team <TEAM_NAME>