{"id":"errors.capture","module":"observability","namespace":"errors","action":"capture","method":"POST","path":"/v1/errors/capture","idempotent":true,"available":true,"vendors":[],"vendors_ready":[],"vendors_pending":[],"key_status":"live","default_vendor":null,"self_hosted":true,"minimum_tier":"standard","supported_message_classes":null,"regions":["western","china"],"dynamic_params":{},"models_tracked":false,"sdk_hint":"Regular parameters + types are stable — read them from the typed SDK signature / API reference for this capability. discovery only carries the runtime-dynamic values above (available, vendors, dynamic_params).","params":{"title":"ErrorCaptureRequest","description":"Request shape for errors.capture — ingest an error/exception event. Returns the event_id. The title falls back to message or exception.value when absent.","type":"object","additionalProperties":false,"properties":{"title":{"type":["string","null"],"description":"Short error title; falls back to message or exception.value."},"message":{"type":["string","null"],"description":"Detailed message content"},"exception":{"type":["object","null"],"description":"Structured exception, e.g. {type, value, stacktrace}."},"level":{"type":"string","default":"error","description":"Severity level (e.g. error, warning, info)."},"tags":{"type":["object","null"],"description":"Tags for categorization and filtering"},"user_id":{"type":["string","null"],"description":"User identifier associated with this resource"},"fingerprint":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Grouping fingerprint."},"breadcrumbs":{"type":["array","null"],"items":{"type":"object"},"description":"List of breadcrumb events leading up to the error"},"context":{"type":["object","null"],"description":"Additional context data for the error"},"extra":{"type":["object","null"],"description":"Extra metadata attached to the error event"},"environment":{"type":["string","null"],"description":"Deployment environment (e.g. production, staging)"},"release":{"type":["string","null"],"description":"Software release version"},"service":{"type":["string","null"],"description":"Service that emitted the error. Stored in the event context."},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}},"response":{"title":"CaptureData","description":"Inner data payload returned by infra.error.capture. See docs/Infrai_SDK_Observability.md §3.2.","type":"object","required":["event_id","fingerprint","error_group_id","is_new_group","dashboard_url"],"additionalProperties":false,"properties":{"event_id":{"type":"string","pattern":"^evt_err_[A-Za-z0-9]{20,}$","description":"Unique identifier for this event"},"fingerprint":{"type":"string","description":"Hex sha256 used for grouping."},"error_group_id":{"type":"string","pattern":"^errgrp_[A-Za-z0-9]{20,}$","description":"Identifier of the error group this event belongs to"},"is_new_group":{"type":"boolean","description":"Whether this capture created a new error group"},"dashboard_url":{"type":"string","format":"uri","description":"URL to view this resource in the dashboard"}}},"errors":["ACCOUNT_AUTORECHARGE_LIMIT","ACCOUNT_FROZEN","AUTH_RATE_LIMIT","AUTH_REFRESH_TOO_FREQUENT","COLD_TIER_NOT_ENABLED","ERROR_EVENT_NOT_FOUND","ERROR_GROUP_NOT_FOUND","ERROR_TAGS_HIGH_CARDINALITY","FLAG_ALREADY_EXISTS","FLAG_DESCRIPTION_TOO_SHORT","FLAG_KEY_INVALID","FLAG_NOT_FOUND","FLAG_RULE_INVALID","FLAG_TYPE_MISMATCH","FLAG_VERSION_CONFLICT","IDEMPOTENCY_KEY_CONFLICT","INSUFFICIENT_CREDIT","INTERNAL_ERROR","INVALID_ARGUMENT","KEY_REVOKED","MAINTENANCE","NETWORK_ERROR","RATE_LIMIT_ACCOUNT","RATE_LIMIT_USER","RATE_LIMIT_VENDOR","RETENTION_FOREVER_NOT_ALLOWED","RETENTION_HARD_CAP_EXCEEDED","SCOPE_INSUFFICIENT","UNAUTHORIZED","VENDOR_AUTH_ERROR","VENDOR_DOWN","VENDOR_TIMEOUT","WALLET_EXPIRED"],"examples":{"curl":"curl -X POST https://api.infrai.cc/v1/errors/capture \\\n  -H \"Authorization: Bearer $INFRAI_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"exception\": {\"type\": \"ValueError\", \"message\": \"bad input\", \"stacktrace\": \"...\"}, \"level\": \"error\"}'","python":"# Zero-install REST call — no SDK required (short-term the API is REST-only).\nimport os, requests\n\nresp = requests.post(\n    \"https://api.infrai.cc/v1/errors/capture\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['INFRAI_API_KEY']}\",\n    },\n    json={'exception': {'type': 'ValueError', 'message': 'bad input', 'stacktrace': '...'}, 'level': 'error'},\n)\nresp.raise_for_status()\nprint(resp.json())","javascript":"// Zero-install REST call — no SDK required (short-term the API is REST-only).\nconst resp = await fetch(\n  \"https://api.infrai.cc/v1/errors/capture\",\n  {\n    method: \"POST\",\n    headers: {\n      \"Authorization\": `Bearer ${process.env.INFRAI_API_KEY}`,\n      \"Content-Type\": \"application/json\",\n    },\n    body: JSON.stringify({\"exception\": {\"type\": \"ValueError\", \"message\": \"bad input\", \"stacktrace\": \"...\"}, \"level\": \"error\"}),\n  },\n);\nconsole.log(await resp.json());","typescript":"// Zero-install REST call — no SDK required (short-term the API is REST-only).\nconst resp = await fetch(\n  \"https://api.infrai.cc/v1/errors/capture\",\n  {\n    method: \"POST\",\n    headers: {\n      \"Authorization\": `Bearer ${process.env.INFRAI_API_KEY}`,\n      \"Content-Type\": \"application/json\",\n    },\n    body: JSON.stringify({\"exception\": {\"type\": \"ValueError\", \"message\": \"bad input\", \"stacktrace\": \"...\"}, \"level\": \"error\"}),\n  },\n);\nif (!resp.ok) throw new Error(`infrai ${resp.status}`);\nconst data: unknown = await resp.json();\nconsole.log(data);","go":"// Zero-install REST call — no SDK required (short-term the API is REST-only).\npackage main\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\tbody := []byte(`{\"exception\": {\"type\": \"ValueError\", \"message\": \"bad input\", \"stacktrace\": \"...\"}, \"level\": \"error\"}`)\n\treq, _ := http.NewRequest(\"POST\", \"https://api.infrai.cc/v1/errors/capture\", bytes.NewReader(body))\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"INFRAI_API_KEY\"))\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\tresp, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer resp.Body.Close()\n\tfmt.Println(resp.Status)\n}","java":"// Zero-install REST call — no SDK required (short-term the API is REST-only).\nimport java.net.URI;\nimport java.net.http.*;\n\nHttpRequest req = HttpRequest.newBuilder()\n    .uri(URI.create(\"https://api.infrai.cc/v1/errors/capture\"))\n    .header(\"Authorization\", \"Bearer \" + System.getenv(\"INFRAI_API_KEY\"))\n    .header(\"Content-Type\", \"application/json\")\n    .method(\"POST\", HttpRequest.BodyPublishers.ofString(\"{\\\"exception\\\": {\\\"type\\\": \\\"ValueError\\\", \\\"message\\\": \\\"bad input\\\", \\\"stacktrace\\\": \\\"...\\\"}, \\\"level\\\": \\\"error\\\"}\"))\n    .build();\nHttpResponse<String> resp = HttpClient.newHttpClient()\n    .send(req, HttpResponse.BodyHandlers.ofString());\nSystem.out.println(resp.body());","csharp":"// Zero-install REST call — no SDK required (short-term the API is REST-only).\nusing System;\nusing System.Net.Http;\n\nvar client = new HttpClient();\nvar req = new HttpRequestMessage(new HttpMethod(\"POST\"), \"https://api.infrai.cc/v1/errors/capture\");\nvar key = Environment.GetEnvironmentVariable(\"INFRAI_API_KEY\");\nreq.Headers.Add(\"Authorization\", \"Bearer \" + key);\nreq.Content = new StringContent(\"{\\\"exception\\\": {\\\"type\\\": \\\"ValueError\\\", \\\"message\\\": \\\"bad input\\\", \\\"stacktrace\\\": \\\"...\\\"}, \\\"level\\\": \\\"error\\\"}\", System.Text.Encoding.UTF8, \"application/json\");\nvar resp = await client.SendAsync(req);\nConsole.WriteLine(await resp.Content.ReadAsStringAsync());","php":"<?php\n// Zero-install REST call — no SDK required (short-term the API is REST-only).\n$ch = curl_init(\"https://api.infrai.cc/v1/errors/capture\");\ncurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"POST\");\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_HTTPHEADER, [\n    \"Authorization: Bearer \" . getenv(\"INFRAI_API_KEY\"),\n    \"Content-Type: application/json\",\n]);\ncurl_setopt($ch, CURLOPT_POSTFIELDS, \"{\\\"exception\\\": {\\\"type\\\": \\\"ValueError\\\", \\\"message\\\": \\\"bad input\\\", \\\"stacktrace\\\": \\\"...\\\"}, \\\"level\\\": \\\"error\\\"}\");\n$response = curl_exec($ch);\ncurl_close($ch);\necho $response;","ruby":"# Zero-install REST call — no SDK required (short-term the API is REST-only).\nrequire \"net/http\"\nrequire \"uri\"\n\nuri = URI(\"https://api.infrai.cc/v1/errors/capture\")\nhttp = Net::HTTP.new(uri.host, uri.port)\nhttp.use_ssl = true\nreq = Net::HTTP::Post.new(uri)\nreq[\"Authorization\"] = \"Bearer #{ENV['INFRAI_API_KEY']}\"\nreq[\"Content-Type\"] = \"application/json\"\nreq.body = '{\"exception\": {\"type\": \"ValueError\", \"message\": \"bad input\", \"stacktrace\": \"...\"}, \"level\": \"error\"}'\nres = http.request(req)\nputs res.body","rust":"// Zero-install REST call — no SDK required (short-term the API is REST-only). (uses the reqwest + tokio crates)\nuse std::env;\n\n#[tokio::main]\nasync fn main() -> Result<(), Box<dyn std::error::Error>> {\n    let resp = reqwest::Client::new()\n        .post(\"https://api.infrai.cc/v1/errors/capture\")\n        .header(\"Authorization\", format!(\"Bearer {}\", env::var(\"INFRAI_API_KEY\")?))\n        .header(\"Content-Type\", \"application/json\")\n        .body(r#\"{\"exception\": {\"type\": \"ValueError\", \"message\": \"bad input\", \"stacktrace\": \"...\"}, \"level\": \"error\"}\"#)\n        .send()\n        .await?;\n    println!(\"{}\", resp.text().await?);\n    Ok(())\n}","request":{"exception":{"type":"ValueError","message":"bad input","stacktrace":"..."},"level":"error"}},"billing":{"is_billable":true,"free":false,"billing_class":"self_dev_market","unit":"per_call","price_usd":5e-05,"currency":"USD","approximate":false,"new_account_trial_uses":39999,"note":"new accounts get $2 free → ~39999 free calls"}}