|
| 1 | +openapi: 3.0.3 |
| 2 | +info: |
| 3 | + title: Helius Admin API |
| 4 | + description: | |
| 5 | + Programmatic access to project usage and billing data. |
| 6 | +
|
| 7 | + ## Authentication |
| 8 | +
|
| 9 | + All requests require an API key passed either as: |
| 10 | + - Header: `X-Api-Key: YOUR_API_KEY` |
| 11 | + - Query parameter: `?api-key=YOUR_API_KEY` |
| 12 | + version: 1.0.0 |
| 13 | + contact: |
| 14 | + name: API Support |
| 15 | + url: https://helius.dev |
| 16 | + |
| 17 | +servers: |
| 18 | + - url: https://api.helius.xyz |
| 19 | + description: Production server |
| 20 | + |
| 21 | +security: |
| 22 | + - ApiKeyQuery: [] |
| 23 | + - ApiKeyHeader: [] |
| 24 | + |
| 25 | +components: |
| 26 | + securitySchemes: |
| 27 | + ApiKeyQuery: |
| 28 | + type: apiKey |
| 29 | + in: query |
| 30 | + name: api-key |
| 31 | + description: API key passed as a query parameter. |
| 32 | + ApiKeyHeader: |
| 33 | + type: apiKey |
| 34 | + in: header |
| 35 | + name: X-Api-Key |
| 36 | + description: API key passed as a request header. |
| 37 | + |
| 38 | + schemas: |
| 39 | + ProjectUsageResponse: |
| 40 | + type: object |
| 41 | + properties: |
| 42 | + creditsRemaining: |
| 43 | + type: number |
| 44 | + description: Number of credits remaining in the current billing cycle. Calculated as `creditsLimit - regularCreditsUsed`, floored at 0. |
| 45 | + example: 487500 |
| 46 | + creditsUsed: |
| 47 | + type: number |
| 48 | + description: Total credits consumed in the current billing cycle, including both regular and prepaid credits. |
| 49 | + example: 12500 |
| 50 | + prepaidCreditsRemaining: |
| 51 | + type: number |
| 52 | + description: Number of prepaid credits remaining. |
| 53 | + example: 50000 |
| 54 | + prepaidCreditsUsed: |
| 55 | + type: number |
| 56 | + description: Number of prepaid credits consumed in the current billing cycle. |
| 57 | + example: 0 |
| 58 | + subscriptionDetails: |
| 59 | + type: object |
| 60 | + description: Details about the project's subscription plan and current billing cycle. |
| 61 | + properties: |
| 62 | + billingCycle: |
| 63 | + type: object |
| 64 | + description: Start and end dates of the current billing cycle. |
| 65 | + properties: |
| 66 | + start: |
| 67 | + type: string |
| 68 | + description: Billing cycle start date. |
| 69 | + example: "2026-04-01" |
| 70 | + end: |
| 71 | + type: string |
| 72 | + description: Billing cycle end date. |
| 73 | + example: "2026-05-01" |
| 74 | + creditsLimit: |
| 75 | + type: number |
| 76 | + description: Total credit allowance for the current billing cycle based on the plan. |
| 77 | + example: 500000 |
| 78 | + plan: |
| 79 | + type: string |
| 80 | + description: The name of the subscription plan. |
| 81 | + example: "business" |
| 82 | + usage: |
| 83 | + type: object |
| 84 | + description: Request counts broken down by service type for the current billing cycle. |
| 85 | + properties: |
| 86 | + api: |
| 87 | + type: number |
| 88 | + description: Number of Enhanced API requests (e.g., parsed transactions, token metadata). |
| 89 | + example: 1200 |
| 90 | + archival: |
| 91 | + type: number |
| 92 | + description: Number of archival RPC requests. |
| 93 | + example: 0 |
| 94 | + das: |
| 95 | + type: number |
| 96 | + description: Number of DAS (Digital Asset Standard) API requests. |
| 97 | + example: 5000 |
| 98 | + grpc: |
| 99 | + type: number |
| 100 | + description: Number of gRPC streaming requests. |
| 101 | + example: 300 |
| 102 | + grpcGeyser: |
| 103 | + type: number |
| 104 | + description: Number of Geyser gRPC requests. |
| 105 | + example: 0 |
| 106 | + photon: |
| 107 | + type: number |
| 108 | + description: Number of ZK Compression (Photon) requests. |
| 109 | + example: 0 |
| 110 | + rpc: |
| 111 | + type: number |
| 112 | + description: Number of standard Solana RPC requests. |
| 113 | + example: 4500 |
| 114 | + stream: |
| 115 | + type: number |
| 116 | + description: Number of LaserStream data streaming requests. |
| 117 | + example: 100 |
| 118 | + webhook: |
| 119 | + type: number |
| 120 | + description: Number of webhook delivery events. |
| 121 | + example: 800 |
| 122 | + websocket: |
| 123 | + type: number |
| 124 | + description: Number of WebSocket subscription requests. |
| 125 | + example: 600 |
| 126 | + |
| 127 | + ErrorResponse: |
| 128 | + type: object |
| 129 | + properties: |
| 130 | + statusCode: |
| 131 | + type: integer |
| 132 | + description: HTTP status code. |
| 133 | + message: |
| 134 | + type: string |
| 135 | + description: Human-readable error message. |
| 136 | + error: |
| 137 | + type: string |
| 138 | + description: HTTP error name. |
| 139 | + |
| 140 | +paths: |
| 141 | + /v0/admin/projects/{id}/usage: |
| 142 | + get: |
| 143 | + tags: |
| 144 | + - Admin |
| 145 | + summary: Get Project Usage |
| 146 | + operationId: getProjectUsage |
| 147 | + description: | |
| 148 | + Retrieve credit usage, subscription details, and per-service request counts for a project within the current billing cycle. |
| 149 | +
|
| 150 | + The API key used for authentication must belong to the project specified in the path. Requests where the API key's project does not match the `id` parameter will return a `400` error. |
| 151 | + parameters: |
| 152 | + - name: id |
| 153 | + in: path |
| 154 | + required: true |
| 155 | + description: The project ID to retrieve usage for. Must match the project associated with the API key. |
| 156 | + schema: |
| 157 | + type: string |
| 158 | + format: uuid |
| 159 | + example: "a1b2c3d4-e5f6-7890-abcd-ef1234567890" |
| 160 | + responses: |
| 161 | + '200': |
| 162 | + description: Project usage retrieved successfully. |
| 163 | + content: |
| 164 | + application/json: |
| 165 | + schema: |
| 166 | + $ref: '#/components/schemas/ProjectUsageResponse' |
| 167 | + example: |
| 168 | + creditsRemaining: 487500 |
| 169 | + creditsUsed: 12500 |
| 170 | + prepaidCreditsRemaining: 50000 |
| 171 | + prepaidCreditsUsed: 0 |
| 172 | + subscriptionDetails: |
| 173 | + billingCycle: |
| 174 | + start: "2026-04-01" |
| 175 | + end: "2026-05-01" |
| 176 | + creditsLimit: 500000 |
| 177 | + plan: "business" |
| 178 | + usage: |
| 179 | + api: 1200 |
| 180 | + archival: 0 |
| 181 | + das: 5000 |
| 182 | + grpc: 300 |
| 183 | + grpcGeyser: 0 |
| 184 | + photon: 0 |
| 185 | + rpc: 4500 |
| 186 | + stream: 100 |
| 187 | + webhook: 800 |
| 188 | + websocket: 600 |
| 189 | + '400': |
| 190 | + description: Bad Request — the project ID in the path does not match the project associated with the API key. |
| 191 | + content: |
| 192 | + application/json: |
| 193 | + schema: |
| 194 | + $ref: '#/components/schemas/ErrorResponse' |
| 195 | + example: |
| 196 | + statusCode: 400 |
| 197 | + message: "Invalid project id" |
| 198 | + error: "Bad Request" |
| 199 | + '401': |
| 200 | + description: Unauthorized — API key is missing, malformed, or not found. |
| 201 | + content: |
| 202 | + application/json: |
| 203 | + schema: |
| 204 | + $ref: '#/components/schemas/ErrorResponse' |
| 205 | + example: |
| 206 | + statusCode: 401 |
| 207 | + message: "Missing or invalid API key" |
| 208 | + error: "Unauthorized" |
| 209 | + '403': |
| 210 | + description: Forbidden — the Admin API is not enabled for this project. |
| 211 | + content: |
| 212 | + application/json: |
| 213 | + schema: |
| 214 | + $ref: '#/components/schemas/ErrorResponse' |
| 215 | + example: |
| 216 | + statusCode: 403 |
| 217 | + message: "Admin API not enabled for this project" |
| 218 | + error: "Forbidden" |
| 219 | + '429': |
| 220 | + description: Too Many Requests — rate limit of 5 requests per second exceeded. |
| 221 | + content: |
| 222 | + application/json: |
| 223 | + schema: |
| 224 | + $ref: '#/components/schemas/ErrorResponse' |
| 225 | + example: |
| 226 | + statusCode: 429 |
| 227 | + message: "ThrottlerException: Too Many Requests" |
| 228 | + error: "Too Many Requests" |
| 229 | + '500': |
| 230 | + description: Internal Server Error — a server-side error occurred (e.g., missing billing data). |
| 231 | + content: |
| 232 | + application/json: |
| 233 | + schema: |
| 234 | + $ref: '#/components/schemas/ErrorResponse' |
| 235 | + example: |
| 236 | + statusCode: 500 |
| 237 | + message: "Internal server error" |
| 238 | + error: "Internal Server Error" |
0 commit comments