REST API
Complete REST API reference for Sematryx. Use HTTP requests to interact with all optimization features and configure Sematryx intelligence.
Base URL
https://api.sematryx.com/v1All API endpoints are prefixed with /v1. Note: Some endpoints use paths like /optimization/instead of /optimize - refer to the endpoint table below for exact paths.
Authentication
Include your API key in the Authorization header for all requests:
Authorization: Bearer YOUR_API_KEYGet your API key from the API Keys page.
Optimization Endpoints
Run Optimization
Upload your objective function first, then run optimization:
curl -X POST https://api.sematryx.com/v1/functions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "sphere",
"code": "def sphere(x): return sum(xi**2 for xi in x)",
"language": "python"
}'curl -X POST https://api.sematryx.com/v1/optimize \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"objective_function_id": "func_1234567890",
"bounds": [[-5, 5], [-5, 5], [-5, 5]],
"max_evaluations": 1000,
"preset": "production"
}'Configure Intelligence
Enable core pillars and configure intelligence features:
curl -X POST https://api.sematryx.com/v1/optimize \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"objective_function_id": "func_1234567890",
"bounds": [[-5, 5], [-5, 5]],
"max_evaluations": 1000,
"intelligence_config": {
"use_agentic_intelligence": true,
"use_interpretable_intelligence": true,
"use_adaptive_intelligence": true,
"explanation_level": 3
}
}'Get Optimization Status
curl -X GET https://api.sematryx.com/v1/optimize/opt_1234567890 \
-H "Authorization: Bearer YOUR_API_KEY"List Optimizations
curl -X GET "https://api.sematryx.com/v1/optimize?limit=20&offset=0" \
-H "Authorization: Bearer YOUR_API_KEY"Domain-Specific Optimization
Use specialized endpoints for domain-specific problems:
curl -X POST https://api.sematryx.com/v1/domains/financial/optimize \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"problem_type": "portfolio",
"config": {
"assets": ["AAPL", "GOOGL", "MSFT"],
"risk_tolerance": 0.15
},
"max_evaluations": 2000
}'Available Domains
financial- Portfolio optimization, trading strategieshealthcare- Drug discovery, clinical trialssupply_chain- Vehicle routing, inventory optimizationai_ml- Hyperparameter tuning, architecture searchmarketing- Campaign optimization, pricingconversational- Natural language problem creation
Conversational Optimization
Create optimization problems through natural language conversation with an AI agent. Perfect for users who want to optimize but aren't familiar with technical optimization concepts.
Start Conversation
curl -X POST https://api.sematryx.com/v1/domains/conversational/create \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"description": "I want to optimize my marketing budget across Google, Facebook, and LinkedIn to maximize ROI"
}'Get Conversation Status
Poll this endpoint to check if the agent has questions ready. Status will be "waiting_for_input" when a question is available.
curl -X GET https://api.sematryx.com/v1/domains/conversational/status/conv_abc123 \
-H "Authorization: Bearer YOUR_API_KEY"Continue Conversation
Provide a response to the agent's question.
curl -X POST https://api.sematryx.com/v1/domains/conversational/continue/conv_abc123 \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"response": "$50000"
}'Complete and Optimize
Once all parameters are collected (status is "ready_to_optimize"), complete the conversation and execute the optimization.
curl -X POST https://api.sematryx.com/v1/domains/conversational/complete/conv_abc123 \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"max_evaluations": 2000,
"mode": "balanced"
}'Learn more: See the Conversational Optimization guide for detailed examples and best practices.
Response Format
Successful responses return JSON with optimization results:
{
"id": "opt_1234567890",
"status": "completed",
"best_solution": [0.001, -0.002, 0.003],
"best_fitness": 0.000014,
"evaluations": 847,
"duration_seconds": 2.34,
"strategy_used": "shgo",
"intelligence_config": {
"use_agentic_intelligence": true,
"use_interpretable_intelligence": true,
"use_adaptive_intelligence": false,
"use_domain_extension": true
},
"features_active": {
"agentic_intelligence": true,
"interpretable_intelligence": true,
"explanation_level": 2
},
"created_at": "2024-01-01T00:00:00Z",
"completed_at": "2024-01-01T00:00:02Z"
}Error responses include an error object:
{
"error": {
"code": "invalid_request",
"message": "The 'bounds' parameter is required",
"field": "bounds"
}
}API Endpoints Reference
Click on any endpoint to view detailed parameter information, request/response examples, and cURL commands.
Advanced
Analytics
Batch
Configuration
ContextComing Soon
These endpoints are planned for a future release. Contact us if you need early access.
Conversational
Data LakeComing Soon
These endpoints are planned for a future release. Contact us if you need early access.
ExamplesComing Soon
These endpoints are planned for a future release. Contact us if you need early access.
Federated Learning
Health
Identity
Learning
Optimization
Request Parameters
Optimization Request
- objective_function_id (required): ID of uploaded function
- bounds (required): Search bounds [[min1, max1], [min2, max2], ...]
- max_evaluations (optional): Maximum function evaluations (default: 1000)
- preset (optional): Preset config ("development", "production", "research", "enterprise", "minimal")
- intelligence_config (optional): Custom intelligence configuration object
Intelligence Configuration
- use_agentic_intelligence (boolean): Enable multi-agent coordination
- use_interpretable_intelligence (boolean): Enable explainability
- use_adaptive_intelligence (boolean): Enable self-improvement
- use_domain_extension (boolean): Enable domain libraries
- explanation_level (integer 0-5): Explanation detail level
- use_gpu_acceleration (boolean): Enable GPU/CUDA
- use_visual_intelligence (boolean): Enable visual analysis
HTTP Status Codes
Request successful
Resource created successfully
Invalid request parameters
Invalid or missing API key
Rate limit exceeded
Server error - contact support
Rate Limiting
API requests are rate-limited. Check response headers for rate limit information:
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 950
X-RateLimit-Reset: 1640995200Pagination
List endpoints support pagination with limit and offset parameters:
GET /v1/optimize?limit=20&offset=40