Docs / API AI

Docs API

API AI kompatível ho OpenAI. Kopia Markdown tomak ka prompt ba Ita-nia AI agent.

Base URL https://api.cyberhatak.arsana.cloud/v1

Loke .md

Hahú lalais#

Cyberhatak nia API kompatível ho OpenAI. Se kódigu Ita uza ona OpenAI SDK, troka base URL no xave deit.

  1. Tama iha dashboard → Tau saldu → hili Saldu AI.
  2. Kria xave foun iha seksaun Xave AI.
  3. Tau xave iha env var no uza base URL iha kraik.
.env
CYBERHATAK_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
CYBERHATAK_BASE_URL=https://api.cyberhatak.arsana.cloud/v1

# Many tools read these standard names too:
OPENAI_API_KEY=$CYBERHATAK_API_KEY
OPENAI_BASE_URL=$CYBERHATAK_BASE_URL

Autentikasaun#

Haruka xave iha header Authorization ho formatu Bearer. Xave hahú ho sk-. Kria xave iha Dashboard → AI → Xave API.

http
Authorization: Bearer sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Keta hatama xave iha kódigu frontend, app mobile ka repo públiku. Se xave sai, hamoos iha dashboard no kria foun.

Chat completions#

POST/v1/chat/completions

Hanesan ho OpenAI. Suporta stream: true (server-sent events).
curl https://api.cyberhatak.arsana.cloud/v1/chat/completions \
  -H "Authorization: Bearer $CYBERHATAK_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-haiku-4-5",
    "messages": [{"role": "user", "content": "Bondia! Explika AI iha liafuan tolu."}]
  }'

Modelu no folin#

GET /v1/models fó lista modelu. Folin iha USD kada 1M token (ezemplu; folin loos hatudu iha dashboard).

ModeluFornesedórInput / 1MOutput / 1MKontekstu
claude-opus-5-5Anthropic$5.20$26.001M
claude-fable-5-1Anthropic$13.00$65.001M
claude-sonnet-5Anthropic$2.60$13.001M
gpt-6-astraOpenAI$13.00$65.00
gpt-6-solOpenAI$2.60$13.00
gemini-3.1-pro-previewGoogle$2.60$15.60
deepseek-v4-proDeepSeek$1.72$5.151M
claude-haiku-4-5Anthropic$1.30$6.50200K
gemini-3.8-flashGoogle$0.98$4.88
glm-5.3Z.ai$1.82$5.72
glm-5.3-flashZ.ai$0.20$0.65
text-embedding-3-smallOpenAI$0.03-8K

GET/v1/models

Lista modelu ne'ebé Ita-nia xave bele uza.
bash
curl https://api.cyberhatak.arsana.cloud/v1/models -H "Authorization: Bearer $CYBERHATAK_API_KEY"

Embeddings#

POST/v1/embeddings

Vektor ba buka no RAG.
bash
curl https://api.cyberhatak.arsana.cloud/v1/embeddings \
  -H "Authorization: Bearer $CYBERHATAK_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "text-embedding-3-small", "input": "Dili, Timor-Leste"}'

Saldu AI#

Ita iha saldu rua. Saldu AI ba pedidu /v1 deit. Saldu konta ba VPS, domíniu no servisu seluk. Saldu ida la tun husi seluk.

  1. Kada pedidu kobra: (token input × folin input + token output × folin output) / 1,000,000.
  2. Bainhira Saldu AI la to'o, API fó erru 402 ho kódigu insufficient_quota too Ita tau saldu.
  3. Haree uzu kada xave iha dashboard.
Pedidu ne'ebé falha tanba ami-nia parte (503 upstream_unavailable) la kobra. Haree estadu iha /status.

Erru#

KódiguSignifikaHalo saida
401 invalid_api_keyMissing, invalid or deleted keyCheck CYBERHATAK_API_KEY
402 insufficient_quotaYour AI balance is too low for this requestTop up the AI balance
404 model_not_foundUnknown modelUse an id from GET /v1/models
400 invalid_requestThe model rejected the request (parameters, length)Fix the request; the message says what
429 rate_limit_exceededToo many requestsRetry with backoff
503 upstream_unavailableTemporary problem on our side; you were not chargedRetry after Retry-After seconds; see /status

Ba AI agent#

Kopia prompt ne'e ba Claude Code, Cursor, Codex ka agent seluk. Agent sei lee dokumentu ne'e rasik no konfigura projetu.

prompt
Read https://cyberhatak.arsana.cloud/docs.md and integrate Cyberhatak AI into this project.
Use the OpenAI-compatible SDK with base URL https://api.cyberhatak.arsana.cloud/v1 and read the key from the env var CYBERHATAK_API_KEY. Do not hard-code the key.

Markdown mentah: https://cyberhatak.arsana.cloud/docs.md · Indise ba LLM: https://cyberhatak.arsana.cloud/llms.txt