Overview
The Giza API uses API key authentication. All authenticated endpoints require two headers to be included with each request.Required Headers
Example Request
Obtaining API Credentials
1
Contact Giza
Reach out to the Giza team to request partner access.
Request Access
Visit gizatech.xyz to get started
2
Receive Credentials
You’ll receive:
- API Key: A unique key for authentication
- Partner Name: Your registered partner identifier
- Backend URL: The API endpoint URL
3
Configure Environment
Store credentials securely as environment variables:
.env
Authentication Scopes
Different endpoints require different authentication levels:Public Endpoints (No Auth Required)
These endpoints can be called without authentication:| Endpoint | Description |
|---|---|
GET /api/v1/healthcheck | Health check |
GET /api/v1/chains | List supported chains |
GET /api/v1/{chain_id}/tokens | List supported tokens |
GET /api/v1/{chain_id}/{token}/protocols | Get protocol information |
GET /api/v1/{chain_id}/wallets/{wallet} | Get wallet information (read-only) |
GET /api/v1/{chain_id}/stats | Get statistics |
Authenticated Endpoints
These endpoints require API key authentication:| Endpoint | Description |
|---|---|
POST /api/v1/{chain_id}/wallets | Activate wallet |
POST /api/v1/{chain_id}/wallets/{wallet}:deactivate | Deactivate wallet |
POST /api/v1/{chain_id}/wallets/{wallet}:withdraw | Withdraw funds |
POST /api/v1/{chain_id}/wallets/{wallet}:run | Trigger agent run |
POST /api/v1/{chain_id}/wallets/{wallet}:top-up | Top up wallet |
POST /api/v1/{chain_id}/wallets/{wallet}:claim-rewards | Claim rewards |
PUT /api/v1/{chain_id}/wallets/{wallet}/protocols | Update protocols |
POST /api/v1/optimizer/{chain_id}/optimize | Optimize allocation |
Error Responses
Invalid or Missing API Key
401 Unauthorized
Access Denied
403 Forbidden
This occurs when:
- Trying to access another partner’s wallet
- API key is inactive
- Partner doesn’t have permission for the operation
Security Best Practices
Store credentials securely
Store credentials securely
- Use environment variables, not hardcoded strings
- Never commit
.envfiles to version control - Use a secrets manager in production (AWS Secrets Manager, HashiCorp Vault, etc.)
Rotate keys periodically
Rotate keys periodically
Contact Giza to regenerate your API key if:
- You suspect it’s been compromised
- An employee with access leaves your organization
- As part of regular security hygiene
Use HTTPS only
Use HTTPS only
Always use HTTPS when making API requests. Never send API keys over unencrypted connections.
Implement server-side calls
Implement server-side calls
Make all authenticated API calls from your backend:
Using with the SDK
The TypeScript SDK handles authentication automatically:SDK Overview
We recommend using the SDK for simplified authentication