Minimum Integration (API or SDK)¶
This guide defines the minimum implementation needed for a new user to run one successful optimization flow.
Path A: API Integration (Hybrid Mode API — your agent as an external service)¶
Implement these endpoints first:
GET /traigent/v1/capabilitiesGET /traigent/v1/config-spacePOST /traigent/v1/execute
Optional (recommended for two-phase quality evaluation):
POST /traigent/v1/evaluate
Minimum behavior contract:
capabilitiesadvertises whether/evaluateis supported.config-spacereturns at least one tunable parameter with a valid domain.executeacceptstunable_id,config,examples, and returns:statusoutputs(withexample_idand eitheroutputoroutput_id)operational_metrics(cost/latency fields)- If combined mode is used, return non-empty
quality_metrics. - If two-phase mode is used, return
quality_metrics: null(or omit it) and implement/evaluate.
Path B: SDK Integration (Function Optimization)¶
Minimum components:
- One callable function to optimize.
- One evaluation dataset.
- One objective (
accuracy,cost, orlatency). - One configuration space with at least one tunable.
Minimal checklist:
- Function can run with deterministic inputs.
- Dataset includes representative samples.
- Objective can be computed from returned outputs.
- At least 3 trial configurations can be sampled.
Environment Minimum¶
- Authentication configured with
traigent auth device-login,traigent onboard, orTRAIGENT_API_KEYfor CI/non-interactive environments. TRAIGENT_API_URLconfigured (if not using default backend URL).- For external-service evaluator scripts using
requests, setUser-Agent: Traigent-SDK/1.0.
15-Minute Acceptance Test¶
A new integration is considered ready when all pass:
- Service health/capabilities endpoints respond successfully.
- Config space is discovered without schema errors.
- One trial executes on a small dataset (3-5 examples).
- Trial returns non-empty metrics and appears in backend monitoring.
- Re-running with a different config changes at least one quality or cost metric.
Troubleshooting Priority¶
- Authentication failures (
401/403): validate key and backend URL. - Endpoint mismatch (
404): verify/traigent/v1/*paths. - Timeouts (
408or client timeout): reduce batch size or increase timeout. - Rate limits (
429): retry with backoff.