Blame
|
1 | # API Quickstart |
||||||
| 2 | ||||||||
| 3 | This quickstart uses the public AeThex API at `https://api.aethex.tech`. |
|||||||
| 4 | ||||||||
| 5 | | Field | Value | |
|||||||
| 6 | |---|---| |
|||||||
| 7 | | Product maturity | Live / evolving | |
|||||||
| 8 | | Documentation status | Active | |
|||||||
| 9 | | Base URL | `https://api.aethex.tech` | |
|||||||
| 10 | | OpenAPI | [[OpenAPI Reference]] | |
|||||||
| 11 | | Last verified | 2026-06-26 | |
|||||||
| 12 | ||||||||
| 13 | ## 1. Check service health |
|||||||
| 14 | ||||||||
| 15 | ```bash |
|||||||
| 16 | curl https://api.aethex.tech/health |
|||||||
| 17 | ``` |
|||||||
| 18 | ||||||||
| 19 | The response reports the API service version, uptime, loaded knowledge count, and enabled model classes. Treat model identifiers as runtime information; clients should not hard-code them. |
|||||||
| 20 | ||||||||
| 21 | ## 2. List available KAEL models |
|||||||
| 22 | ||||||||
| 23 | ```bash |
|||||||
| 24 | curl https://api.aethex.tech/kael/models |
|||||||
| 25 | ``` |
|||||||
| 26 | ||||||||
| 27 | The returned catalog contains stable client keys such as `standard` and their current access tier. |
|||||||
| 28 | ||||||||
| 29 | ## 3. Send a streaming request |
|||||||
| 30 | ||||||||
| 31 | `POST /kael/stream` returns Server-Sent Events. |
|||||||
| 32 | ||||||||
| 33 | ```bash |
|||||||
| 34 | curl --no-buffer https://api.aethex.tech/kael/stream \ |
|||||||
| 35 | -H 'Content-Type: application/json' \ |
|||||||
| 36 | -d '{ |
|||||||
| 37 | "message": "What is AeThex Passport?", |
|||||||
| 38 | "sessionId": "quickstart-example", |
|||||||
| 39 | "source": "docs", |
|||||||
| 40 | "model": "standard" |
|||||||
| 41 | }' |
|||||||
| 42 | ``` |
|||||||
| 43 | ||||||||
| 44 | The stream begins with model metadata, emits JSON events containing response tokens, and ends with: |
|||||||
| 45 | ||||||||
| 46 | ```text |
|||||||
| 47 | data: [DONE] |
|||||||
| 48 | ``` |
|||||||
| 49 | ||||||||
| 50 | ## 4. Handle errors inside the stream |
|||||||
| 51 | ||||||||
| 52 | Because the response is an event stream, some errors arrive as SSE data rather than a non-2xx HTTP response: |
|||||||
| 53 | ||||||||
| 54 | ```json |
|||||||
| 55 | {"error":"rate_limit","clearance":1,"limit":20,"message":"..."} |
|||||||
| 56 | ``` |
|||||||
| 57 | ||||||||
| 58 | Clients should: |
|||||||
| 59 | ||||||||
| 60 | - Parse each `data:` event. |
|||||||
| 61 | - Stop when receiving `[DONE]`. |
|||||||
| 62 | - Handle `error` objects separately from token events. |
|||||||
| 63 | - Reconnect only when appropriate; do not automatically replay a completed prompt. |
|||||||
| 64 | ||||||||
| 65 | ## 5. Choose an identity model |
|||||||
| 66 | ||||||||
| 67 | Public requests can operate without a Passport session but receive lower limits. Signed-in and approved identities can receive expanded capabilities. Tenant keys and operator tokens are separate credentials and must never be embedded in browser code. |
|||||||
| 68 | ||||||||
| 69 | ## Next steps |
|||||||
| 70 | ||||||||
| 71 | - [[API Reference]] |
|||||||
| 72 | - [[Authentication]] |
|||||||
| 73 | - [[Rate Limits]] |
|||||||
| 74 | - [[KAEL API]] |
|||||||
| 75 | - [[Webhooks]] |
|||||||