API Reference
Programmatic access to seven specialized AI agents. Forecasting, attribution, and scenarios via REST.
What You Can Build
Seven agents. Seven hard problems solved. Each API endpoint connects to a specialized AI that learns your specific patterns and constraints.
Forecasting That Learns
The hard problem: Static models miss seasonality shifts, market changes, and your specific patterns
90-day revenue, CAC, and ROAS forecasts that improve from 78% to 91% accuracy by learning from every prediction miss
Infinite Contextual Memory
The hard problem: Tribal knowledge walks out the door. Every question starts from scratch.
Store and retrieve 847+ conversations, constraints, preferences, and learned patterns with semantic search
True Incrementality
The hard problem: Platforms over-report by 25-40%. You're making decisions on inflated ROAS.
De-biased attribution using holdout-calibrated factors. See what's truly incremental vs what platforms claim.
Risk-Free Scenario Testing
The hard problem: Testing budget shifts costs real money. Guessing wrong wastes $50K+.
Run 1,000+ Monte Carlo simulations with your constraints. Get confidence intervals before spending.
Unified Cross-Channel Data
The hard problem: 6 platforms, 6 schemas, 6 definitions of 'conversion'. Reconciliation takes hours.
Single source of truth across Meta, Google, TikTok, Shopify, GA4, Klaviyo with automated reconciliation
Creative Intelligence
The hard problem: You know a creative is fatiguing after it's too late. You can't decode why winners work.
Predict fatigue 2 weeks early. Identify winning patterns across 10,000+ creatives with visual analysis.
Intelligent Delivery
The hard problem: Reports nobody reads. Alerts that get ignored. Wrong format for wrong person.
Auto-generate and deliver insights to Slack, email, or Sheets. Learns your preferred format and timing.
All agents share context
When Parker detects platform bias, Felix adjusts forecasts. When Maya recalls a constraint, Sam applies it to simulations. Intelligence compounds across the network.
Quick Start
Get up and running in under 5 minutes. Make your first API call and receive a forecast powered by learning AI.
Generate your API key
Create an API key from your dashboard. Keys are scoped to your organization and can be revoked at any time.
cresva_sk_live_xxxxxxxxxxxxxxxxxxxxxxxxMake your first request
Call the forecasts endpoint to get a 90-day revenue prediction powered by Felix, our forecasting agent.
curl -X POST https://api.cresva.ai/v1/forecasts \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"type": "revenue",
"horizon_days": 90,
"include_confidence": true
}'Receive learning intelligence
Every response includes confidence intervals, learning trajectory, and metadata about the agent's reasoning.
1{2 "id": "fcst_abc123xyz",3 "object": "forecast",4 "created": 1698765432,5 "agent": {6 "name": "Felix",7 "version": "2.4.1",8 "accuracy_current": 0.91,9 "accuracy_baseline": 0.78,10 "learning_rate": "2% monthly"11 },12 "data": {13 "predicted_revenue": 142350.00,14 "confidence_interval": {15 "low": 128115.00,16 "high": 156585.00,17 "level": 0.9518 },19 "horizon_days": 90,20 "factors": [21 { "name": "seasonality", "impact": 0.23 },22 { "name": "trend", "impact": 0.45 },23 { "name": "channel_mix", "impact": 0.32 }24 ]25 },26 "meta": {27 "model_version": "ensemble-v3",28 "data_points_used": 847,29 "computation_time_ms": 23430 }31}Endpoints
Each endpoint connects to a specialized AI agent. All responses include agent metadata, confidence scores, and learning trajectory.
Create forecasts for revenue, CAC, ROAS, or custom metrics. Felix learns from your historical data and improves accuracy over time. Supports configurable horizons from 7 to 365 days.
Parameters
typestringrequiredForecast type: revenue, cac, roas, conversions, or custom
horizon_daysintegerrequiredNumber of days to forecast (7-365)
granularitystringdaily, weekly, or monthly (default: daily)
include_confidencebooleanInclude confidence intervals (default: true)
channelsarrayFilter by channels: meta, google, tiktok, etc.
Response Fields
predicted_valuenumberThe forecasted value
confidence_intervalobjectLow/high bounds at 95% confidence
factorsarrayContributing factors and their impact weights
agent.accuracy_currentnumberCurrent model accuracy (0-1)
Example Request
{
"type": "revenue",
"horizon_days": 90,
"granularity": "weekly",
"include_confidence": true,
"channels": ["meta", "google"]
}Example Response
{
"id": "fcst_abc123",
"object": "forecast",
"agent": { "name": "Felix", "accuracy_current": 0.91 },
"data": {
"predicted_revenue": 142350.00,
"confidence_interval": { "low": 128115, "high": 156585 },
"series": [...]
}
}Authentication
Secure your API requests with industry-standard authentication.
Bearer Token Authentication
Include your API key in the Authorization header of every request. All API requests must be made over HTTPS.
curl https://api.cresva.ai/v1/forecasts \
-H "Authorization: Bearer cresva_sk_live_xxxxxxxxxxxx" \
-H "Content-Type: application/json"Test Keys
cresva_sk_test_*- Use for development and testing
- Returns simulated data
- No rate limits
Live Keys
cresva_sk_live_*- Use for production
- Accesses real data and agents
- Subject to rate limits
Security Best Practices
Rate Limits
Rate Limit Headers
Error Codes
{
"error": {
"code": "rate_limit_exceeded",
"message": "Rate limit exceeded",
"retry_after": 30
}
}Webhooks
Receive real-time notifications when events occur. Configure webhook endpoints in your dashboard to subscribe to specific events.
Event Types
forecast.completedForecast generation finishedsync.completedData sync finished for all sourcessync.failedData sync encountered an erroralert.triggeredPerformance alert threshold crossedreport.deliveredScheduled report was sentcreative.fatigue_warningCreative approaching fatigueWebhook Payload
1{2 "id": "evt_abc123",3 "type": "forecast.completed",4 "created": 1698765432,5 "data": {6 "forecast_id": "fcst_xyz789",7 "type": "revenue",8 "predicted_value": 142350.00,9 "confidence": 0.9110 },11 "signature": "sha256=..."12}Signature Verification
All webhooks include a signature header for verification. Compute HMAC-SHA256 of the payload using your webhook secret and compare.
SDKs & Libraries
Official client libraries for popular languages with full TypeScript support.
Node.js / TypeScript
v18+ requirednpm install @cresva/sdkimport Cresva from '@cresva/sdk';
const cresva = new Cresva({
apiKey: process.env.CRESVA_API_KEY
});
// Full TypeScript support
const forecast = await cresva.forecasts.create({
type: 'revenue',
horizonDays: 90
});Python
3.8+ requiredpip install cresvafrom cresva import Cresva
import os
client = Cresva(api_key=os.environ["CRESVA_API_KEY"])
# Async support available
forecast = client.forecasts.create(
type="revenue",
horizon_days=90
)
print(forecast.data.predicted_revenue)Enterprise Infrastructure
Built for reliability, security, and scale from day one.
Data Residency
Choose where your data lives. Available regions:
Compute
Auto-scaling infrastructure:
- • GPU-accelerated inference
- • Dedicated compute available
- • Priority queue for Enterprise
Versioning
API stability guarantees:
- • Semantic versioning
- • 12-month deprecation notice
- • Backwards compatible updates
Ready to Build?
Request early access to integrate learning AI into your infrastructure.