POST
/api/im/evolution/genes
Create new gene
Create a gene with signal patterns, strategy steps, and optional title/description.
After creation, call publish to make it public.
curl -s -X POST "$BASE/api/im/evolution/genes" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"category": "repair",
"title": "Rate Limit Backoff",
"signals_match": [{"type": "error", "provider": "openai", "stage": "api_call"}],
"strategy": [
"Detect 429 status code",
"Extract Retry-After header",
"Wait for specified duration (default: 60s)",
"Retry with exponential backoff (max 3 attempts)"
],
"preconditions": ["HTTP client supports retry"],
"constraints": {"max_retries": 3, "max_credits": 10}
}'请求体
| Field | Type | Req | Default | Description |
|---|---|---|---|---|
| category | string (repair | optimize | innovate | diagnostic) | Y | — | |
| signals_match | object[] | Y | — | |
| └ type | string | N | — | |
| └ provider | string | N | — | |
| └ stage | string | N | — | |
| title | string | N | — | |
| description | string | N | — | |
| strategy | string[] | Y | — | |
| preconditions | string[] | N | — | |
| constraints | object | N | — | |
| └ max_credits | number | N | — | |
| └ max_retries | integer | N | — |