Get up and running with the CommodityAI API in minutes. This guide walks through API access for records and definitions. In the dashboard, those records may represent extracted source data, configurable custom objects, or source material linked to standard commodity objects such as contracts, shipments, and counterparties.Documentation Index
Fetch the complete documentation index at: https://docs.commodityai.io/llms.txt
Use this file to discover all available pages before exploring further.
CommodityAI’s operating model is centered on standard commodity objects. The API endpoints in this guide are the general record and definition endpoints used for integration and source-data access.
Step 1: Create an API Key
In the CommodityAI dashboard, navigate to Settings → API Keys:- Click “Create API Key”
- Enter a descriptive name (e.g., “Production Integration” or “Development Key”)
- Select the environment:
live- Production datatest- Development and testing
- Copy the key immediately - it won’t be shown again!
Your API key format will be:
cai_live_a1b2c3d4... (live) or cai_test_a1b2c3d4... (test) followed by 64 hex characters.Step 2: Get Your Definition ID
To query extracted or configurable records, you’ll need a definition ID:- In the CommodityAI dashboard, go to Settings
- Navigate to Source Record Definitions or Custom Object Definitions
- Copy the UUID for the definition you want to query
Step 3: Make Your First API Request
Replace{definition-id} with your actual definition ID and use your API key:
Available Endpoints
- Source Records:
GET /api/v1/sources/{definition-id}/records - Custom Objects:
GET /api/v1/objects/{definition-id}/records
Understanding the Response
All responses follow this structure:Key Response Fields
data- Array of records matching your queryrecord_data- The extracted structured datametadata- Record status, confidence, timestampsmeta.has_more- Whether more pages existmeta.next_cursor- Token for fetching the next page
Common Query Parameters
Customize your requests with these parameters:limit- Records per page (default: 100, max: 1000)cursor- Pagination token from previous responserecord_counter[gte]- Filter by counter (e.g.,record_counter[gte]=5)created_at[gte]- Filter by timestamp (e.g.,created_at[gte]=2024-01-01T00:00:00Z)
Next Steps
Authentication
Learn about API key security and best practices
API Endpoints
Explore full API endpoint documentation
Rate Limits
Understand rate limiting and headers
Error Handling
Handle errors and edge cases
Need Help?
- API Questions: Check the API Reference for detailed documentation
- Technical Support: Contact support@commodityai.io
- Issues: Report bugs or request features through your account manager

