{"openapi":"3.1.0","info":{"title":"Agentyk API","version":"1.0.0","description":"OpenAI-compatible inference API (chat, transcription, speech, embeddings, reranking, realtime) plus API-key management and public reads. Authenticate with an `agk_` API key: `Authorization: Bearer agk_...` or the `X-API-Key` header.\n\n**Errors.** Errors are JSON `{ \"error\": \"<message>\" }` with the HTTP status. Exceptions: a request body that fails validation on a JSON route returns 400 `{ \"success\": false, \"error\": { \"issues\": [...], \"name\": \"ZodError\" } }`, and the opt-in language check on transcription returns 422 with an object `error`. 401 = missing or invalid key; 403 = not in your plan; 429 = rate, quota or capacity limit (honour `Retry-After` when present; when it is absent, retry after a short back-off); 502/503/504 = temporary service problem, safe to retry. Failed requests are not billed."},"servers":[{"url":"https://api.agentyk.xyz"}],"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"agk_ API key — send as `Authorization: Bearer agk_…` or the `X-API-Key` header."},"accessToken":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"User session access JWT."}},"schemas":{"PlanList":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"intervalDays":{"type":"number"},"currency":{"type":"string"},"listAmountCents":{"type":"number","description":"List price in cents (before any campaign discount), VAT-inclusive."},"effectiveAmountCents":{"type":"number","description":"Price actually charged in cents (after active discount campaign), VAT-inclusive."},"amountValue":{"type":"string","description":"Effective price as a decimal string, e.g. \"9.90\"."},"vat":{"type":"object","properties":{"grossCents":{"type":"number"},"netCents":{"type":"number"},"vatCents":{"type":"number"},"rateBps":{"type":"number"}},"required":["grossCents","netCents","vatCents","rateBps"]},"discount":{"type":["object","null"],"properties":{"campaignId":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"},"value":{"type":"number"},"offCents":{"type":"number"},"durationMonths":{"type":["number","null"]}},"required":["campaignId","name","type","value","offCents","durationMonths"],"description":"Active discount campaign, or null."},"entitlements":{"type":"object","properties":{"allowedApps":{"type":"array","items":{"type":"string"}},"allowedModels":{"type":"array","items":{"type":"string"}},"tokenQuotaMonthly":{"type":"number"},"deviceQuota":{"type":"number"},"cloudMsgQuotaLimit":{"type":"number"}},"required":["allowedApps","allowedModels","tokenQuotaMonthly","deviceQuota","cloudMsgQuotaLimit"]}},"required":["id","name","description","intervalDays","currency","listAmountCents","effectiveAmountCents","amountValue","vat","discount","entitlements"]}},"RateCard":{"type":"object","properties":{"currency":{"type":"string"},"unit_token_rates":{"type":"string"},"unit_per_call_rates":{"type":"string"},"unit_audio_rates":{"type":"string"},"inference":{"type":"object","additionalProperties":{"type":"object","properties":{"inputPerMtokMc":{"type":"number"},"outputPerMtokMc":{"type":"number"},"cachedInputMultiplier":{"type":"number","description":"Fraction of this tier's input rate charged for cached input tokens. Absent means the platform default in `cachedInputDiscount` applies."}},"required":["inputPerMtokMc","outputPerMtokMc"]},"description":"Per-tier token rates (milli-cents per million tokens), keyed by model codename."},"cachedInputDiscount":{"type":"number","description":"DEFAULT fraction of the input rate charged for cached input tokens (0.25 = a quarter of the full input price). A tier that publishes its own `cachedInputMultiplier` uses that instead."},"scribe":{"type":"object","additionalProperties":{"type":"object","properties":{"perAudioMinuteMc":{"type":"number","description":"Milli-cents per minute of audio, pro-rated to the second over the whole request. 66.666… = €0.04 per audio-hour."},"minBilledSeconds":{"type":"number","description":"Minimum billed length in seconds. A request with a shorter measured duration is charged as this length. 0 = no minimum. A request whose duration could not be measured is charged nothing and is never lifted to this minimum."}},"required":["perAudioMinuteMc","minBilledSeconds"]},"description":"Speech-to-text rates per audio-minute, keyed by billing tier. The batch tiers are €0.04 per audio-hour with a 10-second minimum billed length; Scribe Live is metered per session at no charge."},"forecast":{"type":"object","additionalProperties":{"type":"object","properties":{"basePerCallMc":{"type":"number"},"perExtraStepMc":{"type":"number"}},"required":["basePerCallMc","perExtraStepMc"]}},"rag":{"type":"object","properties":{"perQueryMc":{"type":"number"},"perIndexedChunkMc":{"type":"number"}},"required":["perQueryMc","perIndexedChunkMc"]},"volumeTiers":{"type":"array","items":{"type":"object","properties":{"thresholdMc":{"type":"number"},"discountBps":{"type":"number"},"label":{"type":"string"}},"required":["thresholdMc","discountBps","label"]}}},"required":["currency","unit_token_rates","unit_per_call_rates","unit_audio_rates","inference","cachedInputDiscount","scribe","forecast","rag","volumeTiers"]},"ApiKeySummary":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"keyPrefix":{"type":"string","description":"First 12 chars of the key (`agk_…`), shown in the UI."},"expiresAt":{"type":["string","null"]},"revokedAt":{"type":["string","null"]},"lastUsedAt":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","name","keyPrefix","expiresAt","revokedAt","lastUsedAt","createdAt"]},"ApiKeyList":{"type":"object","properties":{"apiKeys":{"type":"array","items":{"$ref":"#/components/schemas/ApiKeySummary"}}},"required":["apiKeys"]},"CreateApiKeyResponse":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"key":{"type":"string","description":"The full `agk_` secret — shown ONCE. Store it now; it cannot be retrieved again."},"keyPrefix":{"type":"string"},"expiresAt":{"type":["string","null"]}},"required":["id","name","key","keyPrefix","expiresAt"]},"CreateApiKeyRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120,"description":"Human-readable label for the key.","example":"ci-pipeline"},"ttlDays":{"type":"integer","minimum":1,"maximum":3650,"description":"Optional time-to-live in days (1–3650). Omit for a non-expiring key.","example":365}},"required":["name"],"additionalProperties":false},"RevokeApiKeyResponse":{"type":"object","properties":{"revoked":{"type":"boolean"},"alreadyRevoked":{"type":"boolean"}}},"RevocationList":{"type":"object","properties":{"revoked":{"type":"array","items":{"type":"object","properties":{"jti":{"type":"string"},"revoked_at":{"type":"string"}},"required":["jti","revoked_at"]}},"generated_at":{"type":"string"},"next_since":{"type":"string","description":"Echo back as ?since= on the next poll."},"next_since_jti":{"type":["string","null"],"description":"When truncated, echo back as ?since_jti= on the next poll."},"truncated":{"type":"boolean"},"cutoff":{"type":"string"}},"required":["revoked","generated_at","next_since","next_since_jti","truncated","cutoff"]},"AudioTranscription":{"type":"object","properties":{"text":{"type":"string","description":"The transcribed text."}},"required":["text"]},"Error":{"type":"object","properties":{"error":{"anyOf":[{"type":"string","description":"Human-readable message."},{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string","example":"language_mismatch"},"code":{"type":"integer","example":422},"language_candidates":{"type":"array","items":{"type":"object","properties":{"language":{"type":"string"},"probability":{"type":"number"}},"required":["language","probability"]}}},"required":["message","type","code"]}]}},"required":["error"]},"AudioTranscriptionRequest":{"type":"object","properties":{"file":{"type":"string","description":"**Required.** The audio file to transcribe (≤ 25 MiB), in any common audio or video container (for example mp3, mp4, m4a, wav, webm, ogg/opus, flac).","format":"binary"},"model":{"type":"string","description":"**Required.** `agentyk-scribe-1.0` (90+ languages), or `agentyk-scribe-urdu-1.0` (tuned for Urdu; transcription only; if it is unavailable, fails or runs out of time, the request is served by `agentyk-scribe-1.0` instead of failing). Both are billed at the same rate. The Urdu model's language detection favours Urdu: its language probabilities (`language`, `language_probability`, `language_candidates`, and therefore `allowed_languages` decisions) are not reliable for other languages, so use `agentyk-scribe-1.0` for language identification.","example":"agentyk-scribe-1.0"},"response_format":{"type":"string","description":"`json` (default) → `{ text }`; `text` → plain-text body; `verbose_json` → `{ task, language, duration, text, segments: [{ start, end, text }] }` plus the opt-in language fields below. `segments` is always present (possibly empty). `language` is the detected language, or the `language` you sent. `srt`/`vtt` are not supported (400, not billed).","example":"json"},"language":{"type":"string","description":"Optional ISO-639-1 source-language hint (e.g. `en`, `nl`). Auto-detected if omitted."},"prompt":{"type":"string","description":"Optional text to bias decoding toward specific names or jargon."},"temperature":{"type":"string","description":"Optional sampling temperature, 0–1."},"allowed_languages":{"type":"string","description":"Optional. Up to 10 ISO-639-1 codes (comma-separated, or a JSON array). The clip is transcribed in the most probable of these languages. Ignored when `language` is set. `verbose_json` then also returns `language_probability`, `language_candidates` (top 5) and `language_mismatch`.","example":"en,nl"},"on_language_mismatch":{"type":"string","description":"With `allowed_languages`: `transcribe` (default) transcribes anyway and sets `language_mismatch: true` when the speech is unlikely to be in any allowed language; `error` returns HTTP 422 instead (not billed).","example":"transcribe"},"include":{"type":"string","description":"Optional. `language_candidates` adds the top-5 detected languages with probabilities to `verbose_json`.","example":"language_candidates"}}},"SpeechRequest":{"type":"object","properties":{"model":{"type":"string","description":"**Required.** Voice model: `agentyk-voice-1.0` (also accepted as `voice-express`) or `agentyk-voice-express-1.0` — a lighter, markedly faster voice.","example":"agentyk-voice-express-1.0"},"input":{"type":"string","description":"**Required.** The text to synthesize."},"voice":{"type":"string","description":"Optional. For `agentyk-voice-1.0`: one of the house voices, `standaard` (the default when omitted), `nl-1`, `nl-2`, `vl-1`, `vl-2` or `vl-3`; `GET /v1/voices` lists the ones available to you. For a model that supports registered voices: the id of a voice you registered with `POST /v1/voices`; a voice belonging to another account answers 404, exactly as a missing one does.","example":"tf0a1b2c3_9f8e7d6c5b"},"language":{"type":"string","description":"Optional ISO-639-1 language hint (e.g. `nl`, `en`)."},"speed":{"type":"number","description":"Optional delivery speed, 0.5–2.0 (`agentyk-voice-express-1.0` only; lower is slower). Omit for the tuned default.","example":0.9}},"required":["model","input"]},"Voice":{"type":"object","properties":{"voice":{"type":"string","description":"The id to pass as `voice` when synthesizing.","example":"ta1b2c3d4_9f8e7d6c5b"},"label":{"type":["string","null"],"description":"Your own label for this voice."},"consent":{"type":"string","description":"Who consented to this voice being cloned, as you recorded it."},"reference_seconds":{"type":["number","null"]},"created_at":{"type":"string"}},"required":["voice","label","consent","reference_seconds","created_at"]},"VoiceList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Voice"}}},"required":["data"]},"VoiceDeleted":{"type":"object","properties":{"voice":{"type":"string"},"deleted":{"type":"boolean"}},"required":["voice","deleted"]},"ChatCompletion":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string"},"created":{"type":"number"},"model":{"type":"string"},"choices":{"type":"array","items":{}},"usage":{}},"required":["id","object","created","model","choices"]},"ChatMessage":{"type":"object","properties":{"role":{"type":"string","description":"system, user, assistant or tool.","example":"user"},"content":{"description":"The message text, or an array of content parts (text, image_url, input_audio). May be null on an assistant message that carries tool_calls.","anyOf":[{"type":"string"},{"type":"array","items":{"type":"object","description":"One content part. `type` selects which of the other fields is used.","properties":{"type":{"type":"string","enum":["text","image_url","input_audio"]},"text":{"type":"string","description":"For type `text`."},"image_url":{"type":"object","description":"For type `image_url`.","properties":{"url":{"type":"string","description":"An https URL or a data: URL."}}},"input_audio":{"type":"object","description":"For type `input_audio` (base64 audio).","properties":{"data":{"type":"string"},"format":{"type":"string","example":"wav"}}}},"required":["type"]}},{"type":"null"}]}},"required":["role"]},"ChatCompletionRequest":{"type":"object","properties":{"model":{"type":"string","description":"Tier codename: jaguar, tiger, leopard, greyhound, cheetah, grizzly, gazelle, mongoose, hummingbird.","example":"jaguar"},"messages":{"type":"array","items":{"$ref":"#/components/schemas/ChatMessage"}},"max_tokens":{"type":"integer"},"temperature":{"type":"number"},"stream":{"type":"boolean","description":"When true, responds with an OpenAI-style SSE stream."},"agentyk_tools":{"type":"array","items":{"type":"string","enum":["web_search","fetch_url"]},"description":"Run these tools server-side during the completion."},"max_completion_tokens":{"type":"integer","description":"Alias of max_tokens."},"top_p":{"type":"number","description":"Nucleus sampling."},"top_k":{"type":"integer","description":"Top-k sampling."},"min_p":{"type":"number","description":"Min-p sampling."},"presence_penalty":{"type":"number","description":"Presence penalty."},"frequency_penalty":{"type":"number","description":"Frequency penalty."},"repeat_penalty":{"type":"number","description":"Repetition penalty (1 = none)."},"seed":{"type":"integer","description":"Sampling seed."},"stop":{"description":"Up to four sequences at which generation stops.","anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"stream_options":{"type":"object","description":"With stream:true. The final chunk always carries usage.","properties":{"include_usage":{"type":"boolean"}}},"response_format":{"type":"object","description":"Structured output. `json_object` asks for any JSON object. `json_schema` constrains the output to your schema with a grammar: it pins the shape of the JSON (keys, types, enums), not the characters inside a string.","properties":{"type":{"type":"string","enum":["text","json_object","json_schema"]},"json_schema":{"type":"object","properties":{"name":{"type":"string"},"strict":{"type":"boolean"},"schema":{"type":"object","description":"A JSON Schema object."}}}}},"grammar":{"type":"string","description":"A GBNF grammar that constrains the output, character by character. Rule names may contain only letters, digits and '-'. A grammar that does not parse is rejected with HTTP 400 and error type `invalid_grammar`. Do not combine with response_format json_schema."},"tools":{"type":"array","description":"OpenAI-style function tools the model may call.","items":{"type":"object","properties":{"type":{"type":"string","enum":["function"]},"function":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"parameters":{"type":"object","description":"A JSON Schema object for the arguments."}}}}}},"tool_choice":{"description":"`auto`, `none`, `required`, or {type:'function', function:{name}} to force one function.","anyOf":[{"type":"string","enum":["auto","none","required"]},{"type":"object","properties":{"type":{"type":"string","enum":["function"]},"function":{"type":"object","properties":{"name":{"type":"string"}}}}}]},"agentyk_strict_tools":{"type":"boolean","description":"Agentyk extension. On a non-streaming call that forces one function, enforce that function's parameters schema with a grammar. The response header X-Agentyk-Strict-Tools says `enforced` or `fallback`, and X-Agentyk-Strict-Tools-Reason says why a fallback happened."},"chat_template_kwargs":{"type":"object","description":"Template options. Thinking is OFF by default; set {\"enable_thinking\": true} to turn it on. This is the control that works. With thinking on, any of temperature, top_p, top_k, min_p and presence_penalty that you leave out is set to a value recommended for the model; a value you send is always used as sent. Thinking works best with those recommended values: a temperature of 0 with thinking on can make the output repeat itself.","properties":{"enable_thinking":{"type":"boolean"}}},"reasoning_effort":{"type":"string","description":"Accepted for OpenAI compatibility but currently IGNORED: it does not turn thinking on or off on any model. Use chat_template_kwargs.enable_thinking instead."}}},"ModelList":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"jaguar"},"object":{"type":"string","enum":["model"]},"owned_by":{"type":"string","example":"agentyk"}},"required":["id","object","owned_by"]}}},"required":["object","data"]},"Embedding":{"type":"object","properties":{"object":{"type":"string"},"data":{"type":"array","items":{"type":"object","properties":{"object":{"type":"string"},"embedding":{"type":"array","items":{"type":"number"}},"index":{"type":"integer"}},"required":["object","embedding","index"]}},"model":{"type":"string"},"usage":{"type":"object","properties":{"prompt_tokens":{"type":"integer"},"total_tokens":{"type":"integer"}}}},"required":["object","data","model","usage"]},"EmbeddingRequest":{"type":"object","properties":{"model":{"type":"string","description":"Embedding model id. Only agentyk-embedding-1.0 is available.","example":"agentyk-embedding-1.0"},"input":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"A string, or a non-empty array of strings, to embed."},"encoding_format":{"type":"string","description":"float (default) or base64."}}},"Rerank":{"type":"object","properties":{"model":{"type":"string"},"results":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer"},"relevance_score":{"type":"number"}},"required":["index","relevance_score"]}}},"required":["model","results"]},"RerankRequest":{"type":"object","properties":{"model":{"type":"string","description":"Reranker model id. Only agentyk-reranker-1.0 is available.","example":"agentyk-reranker-1.0"},"query":{"type":"string","description":"The search query to rank documents against."},"documents":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"object","properties":{"text":{"type":"string"}},"required":["text"]}]},"description":"Documents to rerank — strings or {text} objects."},"top_n":{"type":"integer","description":"Return only the top N results."},"instruction":{"type":"string"}}},"KnowledgeIngestDocument":{"type":"object","properties":{"document_id":{"type":"string"},"text":{"type":"string"}},"required":["document_id","text"]},"KnowledgeGround":{"type":"object","properties":{"question":{"type":"string"},"k":{"type":"integer"}},"required":["question"]},"KnowledgeGroundAnswerResponse":{"type":"object","properties":{"answer":{"type":"string"},"citations":{"type":"array","items":{"type":"object","properties":{"n":{"type":"integer"},"claim_iri":{"type":"string"},"subject":{"type":"string"},"predicate":{"type":"string"},"object":{"type":"string"}},"required":["n","claim_iri","subject","predicate","object"]}}},"required":["answer","citations"]},"KnowledgeGroundAnswer":{"type":"object","properties":{"question":{"type":"string"},"k":{"type":"integer"}},"required":["question"]},"KnowledgeIngestPreview":{"type":"object","properties":{"document_id":{"type":"string"},"text":{"type":"string"}},"required":["document_id","text"]},"V1UsageBreakdown":{"type":"object","properties":{}},"DecisionYesNoAnswer":{"type":"object","properties":{"type":{"type":"string","enum":["yes_no"]},"answer":{"type":"boolean","description":"True when `probability` is at least 0.5."},"probability":{"type":"number","minimum":0,"maximum":1,"description":"The probability of yes.","example":0.999}},"required":["type","answer","probability"]},"DecisionChoiceAnswer":{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"answer":{"type":["string","null"],"description":"The most probable option key.","example":"customer_service"},"probabilities":{"type":"object","additionalProperties":{"type":"number"},"description":"One probability per option key, in your order; they sum to 1."},"confidence":{"type":"number","minimum":0,"maximum":1,"description":"0 when all options are equally likely, 1 when certain.","example":0.375}},"required":["type","answer","probabilities","confidence"]},"DecisionScoreAnswer":{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"score":{"type":"number","description":"The expected level position: 0 for the first level up to n - 1 for the last.","example":1.315},"answer":{"type":"string","description":"The most probable level.","example":"annoyed"},"probabilities":{"type":"object","additionalProperties":{"type":"number"},"description":"One probability per level, lowest first; they sum to 1."},"confidence":{"type":"number","minimum":0,"maximum":1,"description":"0 when all levels are equally likely, 1 when certain.","example":0.368}},"required":["type","score","answer","probabilities","confidence"]},"DecisionQuestionError":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["input_too_long","invalid_question","model_error"],"example":"input_too_long"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"],"description":"This question could not be answered; the others still are. Not billed."},"DecisionResponse":{"type":"object","properties":{"id":{"type":"string","example":"dec_034313f515cd8fe205692a7fb551d378"},"object":{"type":"string","enum":["decision"]},"created":{"type":"integer","description":"Unix time in seconds."},"model":{"type":"string","example":"agentyk-decision-1.0"},"answers":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#/components/schemas/DecisionYesNoAnswer"},{"$ref":"#/components/schemas/DecisionChoiceAnswer"},{"$ref":"#/components/schemas/DecisionScoreAnswer"},{"$ref":"#/components/schemas/DecisionQuestionError"}]},"description":"One entry per question, under the question's id."},"usage":{"type":"object","properties":{"questions":{"type":"integer","description":"Questions in the request."},"input_tokens":{"type":"integer","description":"Tokens of the input alone."},"prompt_tokens":{"type":"integer","description":"Tokens read over all answered questions."},"billed_tokens":{"type":"integer","description":"Tokens charged: prompt_tokens, at least 120 per request; 0 when nothing was answered."}},"required":["questions","input_tokens","prompt_tokens","billed_tokens"]}},"required":["id","object","created","model","answers","usage"],"example":{"id":"dec_034313f515cd8fe205692a7fb551d378","object":"decision","created":1794126688,"model":"agentyk-decision-1.0","answers":{"complaint":{"type":"yes_no","answer":true,"probability":0.999},"topic":{"type":"choice","answer":"customer_service","probabilities":{"delivery":0.455,"billing":0.001,"product_quality":0.052,"customer_service":0.492},"confidence":0.375},"anger":{"type":"score","score":1.315,"answer":"annoyed","probabilities":{"calm":0.032,"annoyed":0.673,"angry":0.242,"furious":0.053},"confidence":0.368}},"usage":{"questions":3,"input_tokens":10,"prompt_tokens":313,"billed_tokens":313}}},"DecisionError":{"type":"object","properties":{"error":{"anyOf":[{"type":"string","description":"Human-readable message."},{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string","enum":["concurrency_limit","over_capacity","unavailable"]},"code":{"type":"integer"}},"required":["message","type","code"]}]}},"required":["error"]},"DecisionYesNoQuestion":{"type":"object","properties":{"type":{"type":"string","enum":["yes_no"]},"question":{"type":"string","description":"The question, in your own words. Optional, but answers are better with it.","example":"Is this a complaint?"},"yes":{"type":["string","null"],"description":"Optional: what a yes means.","example":"The writer is unhappy and wants something done."},"no":{"type":["string","null"],"description":"Optional: what a no means."}},"required":["type"],"description":"A yes or no question."},"DecisionChoiceQuestion":{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"question":{"type":"string","description":"The question, in your own words. Optional, but answers are better with it.","example":"Is this a complaint?"},"options":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":200,"description":"The value returned as `answer` when this option wins. Keys must be distinct.","example":"customer_service"},"description":{"type":["string","null"],"description":"Optional: what this option means.","example":"how staff respond"}},"required":["key"]},"minItems":1,"maxItems":255,"description":"1 to 255 options. The order you send is kept."}},"required":["type","options"],"description":"Pick one option from your own list."},"DecisionScoreQuestion":{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"question":{"type":"string","description":"The question, in your own words. Optional, but answers are better with it.","example":"Is this a complaint?"},"levels":{"type":"array","items":{"type":"string","minLength":1},"minItems":2,"maxItems":10,"description":"2 to 10 distinct labels, lowest first.","example":["calm","annoyed","angry","furious"]}},"required":["type","levels"],"description":"Place the input on your own ordered scale."},"DecisionRequest":{"type":"object","properties":{"model":{"type":"string","enum":["agentyk-decision-1.0","agentyk-decision-flash-1.0"],"description":"`agentyk-decision-1.0` (default) or `agentyk-decision-flash-1.0`.","example":"agentyk-decision-1.0"},"input":{"anyOf":[{"type":"string","minLength":1},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}],"description":"The text to read. A JSON object or array (for example a data record) is accepted too and read as its JSON text.","example":"The parcel arrived broken and nobody answers my emails."},"questions":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#/components/schemas/DecisionYesNoQuestion"},{"$ref":"#/components/schemas/DecisionChoiceQuestion"},{"$ref":"#/components/schemas/DecisionScoreQuestion"}]},"description":"1 to 16 questions, each under an id you choose (1 to 64 characters). Answers come back under the same ids."}},"required":["input","questions"],"example":{"model":"agentyk-decision-1.0","input":"The parcel arrived broken and nobody answers my emails.","questions":{"complaint":{"type":"yes_no","question":"Is this a complaint?"},"topic":{"type":"choice","question":"What is it mainly about?","options":[{"key":"delivery"},{"key":"billing"},{"key":"product_quality"},{"key":"customer_service","description":"how staff respond"}]},"anger":{"type":"score","question":"How angry is the writer?","levels":["calm","annoyed","angry","furious"]}}}}},"parameters":{}},"paths":{"/api/subscriptions/plans":{"get":{"tags":["Subscriptions"],"summary":"List sellable plans","description":"Public plan catalogue with the effective (post-campaign) VAT-inclusive price + VAT breakdown. No auth required.","responses":{"200":{"description":"The plan catalogue.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanList"}}}}}}},"/api/credits/rates":{"get":{"tags":["Credits"],"summary":"Published rate card","description":"Public pricing for inference, speech-to-text, forecast, RAG, the cached-input discount, and volume tiers. No auth required.","responses":{"200":{"description":"The current rate card.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateCard"}}}}}}},"/api/keys":{"get":{"tags":["API keys"],"summary":"List API keys","description":"Returns the tenant's API keys (newest first). Secrets are never returned — only the `agk_…` prefix.","security":[{"accessToken":[]}],"responses":{"200":{"description":"The tenant's API keys.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyList"}}}}}},"post":{"tags":["API keys"],"summary":"Create an API key","description":"Mints a new long-lived `agk_` bearer key for the LLM (`/v1/chat/completions`) and Scribe (`/v1/audio/transcriptions`) APIs. The full secret is returned ONCE. Requires the owner or admin role, a verified email and a plan that includes API access.","security":[{"accessToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApiKeyRequest"}}}},"responses":{"201":{"description":"The created key, including the one-time plaintext secret.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApiKeyResponse"}}}}}}},"/api/keys/{id}":{"delete":{"tags":["API keys"],"summary":"Revoke an API key","description":"Revokes one of the tenant's API keys by id. Requires the owner or admin role. Idempotent — revoking an already-revoked key returns `{ alreadyRevoked: true }`.","security":[{"accessToken":[]}],"parameters":[{"schema":{"type":"string","example":"3515ff39-f4a0-4237-976a-cfa70558b619"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Revocation result.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevokeApiKeyResponse"}}}}}}},"/api/licenses/revocations":{"get":{"tags":["Licenses"],"summary":"Public revocation list","description":"Public endpoint polled by SDK clients. Returns revoked-license jtis newer than `since` (defaults to the last 90 days), paginated via the `(next_since, next_since_jti)` composite cursor.","parameters":[{"schema":{"type":"string","format":"date-time","description":"ISO-8601 timestamp — return revocations after this. Defaults to 90 days ago."},"required":false,"name":"since","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":64,"description":"Composite-cursor tiebreaker — echo back `next_since_jti` from the previous page."},"required":false,"name":"since_jti","in":"query"}],"responses":{"200":{"description":"A page of revocations + the next cursor.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevocationList"}}}}}}},"/v1/audio/transcriptions":{"post":{"tags":["Audio"],"summary":"Transcribe audio (OpenAI-compatible)","description":"Transcribe an audio file to text in its source language (90+ languages supported). `multipart/form-data`, drop-in for OpenAI's `POST /v1/audio/transcriptions`. Billed at €0.04 per hour of audio from the detected duration, pro-rated to the second, with a minimum billed length of 10 seconds — a shorter clip is charged as 10 seconds, and a clip whose duration cannot be measured is not charged at all. At most 60 minutes of audio are billed per request. Requires the `agentyk-scribe` entitlement on the API key's tenant. Rate limit: 300 requests per minute per IP. Translation (`/v1/audio/translations`) is not offered. Requests that fail are not billed.","security":[{"apiKey":[]}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/AudioTranscriptionRequest"}}}},"responses":{"200":{"description":"Transcription result. Shape depends on `response_format` (default `json` → `{ text }`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AudioTranscription"}}}},"400":{"description":"Missing `file` or `model`, empty or oversized file, unknown model, unsupported `response_format`, an invalid language-control field, or audio that cannot be decoded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`agentyk-scribe` not in the current plan.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Only with `on_language_mismatch=error`: the speech does not appear to be in any of `allowed_languages`. `error` is an object `{ message, type: \"language_mismatch\", code: 422, language_candidates }`. Not billed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit; the monthly audio-minute limit of your plan (`Retry-After` in seconds); or transcription at capacity. **Known issue:** the at-capacity response currently has the body `{\"error\": \"\"}` and no `Retry-After` header; retry it after a short back-off (1 to 5 seconds).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The transcription service failed; retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Transcription is not available on this server.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Transcription took too long (very long files); retry, or split the file.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/audio/speech":{"post":{"tags":["Audio"],"summary":"Synthesize speech (OpenAI-compatible)","description":"Generate speech (`audio/wav`, 24 kHz) from text. Drop-in for OpenAI's `POST /v1/audio/speech`. Express tier — requires the `agentyk-llm-express` entitlement; billed per 1k input characters.","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SpeechRequest"}}}},"responses":{"200":{"description":"WAV audio (24 kHz mono).","content":{"audio/wav":{"schema":{"type":"string","format":"binary"}}}}}}},"/v1/voices":{"post":{"tags":["Audio"],"summary":"Register a cloned voice from a reference clip","description":"Encode a reference recording into a voice you can then select with `voice` on `POST /v1/audio/speech`. `multipart/form-data` with `file` (the recording), `consent` (**required** — who agreed to this voice being cloned) and an optional `label`. The recording is used to derive the voice and is not stored. Every output remains watermarked. Requires a plan that includes registered voices; rate-limited to 12 registrations an hour.","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","description":"**Required.** The reference recording (WAV).","format":"binary"},"consent":{"type":"string","description":"**Required.** Who consented to this voice being cloned."},"label":{"type":"string","description":"Optional label, for your own listing."}},"required":["consent"]}}}},"responses":{"200":{"description":"The registered voice.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Voice"}}}}}},"get":{"tags":["Audio"],"summary":"List your cloned voices","description":"The voices registered on your account, newest first. Deleted voices are not listed.","security":[{"apiKey":[]}],"responses":{"200":{"description":"Your voices.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceList"}}}}}}},"/v1/voices/{voice}":{"delete":{"tags":["Audio"],"summary":"Delete one of your cloned voices","description":"Remove a voice and the conditioning derived from its reference recording. The recording itself was never stored. A voice belonging to another account, or one already deleted, answers 404.","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","description":"The voice id."},"required":true,"name":"voice","in":"path"}],"responses":{"200":{"description":"Deleted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceDeleted"}}}}}}},"/v1/chat/completions":{"post":{"tags":["Inference"],"summary":"Chat completion (OpenAI-compatible)","description":"OpenAI-compatible. Requires the agentyk-llm entitlement. Set stream:true for an SSE stream. Optional agentyk_tools:['web_search','fetch_url'] runs those tools server-side. The body round-trips to the model upstream, so any OpenAI parameter is accepted. `model` is one of the chat ids from `GET /v1/models` (for example `jaguar`); an unknown or unavailable id returns 400 listing the available ones. Ids ending in `-express` also require the `agentyk-llm-express` add-on and are billed per token.","security":[{"apiKey":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatCompletionRequest"}}}},"responses":{"200":{"description":"OpenAI chat.completion object (or an SSE stream when stream:true).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatCompletion"}}}}}}},"/v1/models":{"get":{"tags":["Inference"],"summary":"List available model tiers","description":"OpenAI-compatible. Returns the model ids this server serves that your plan can call: the chat tiers (for example `jaguar`; ids ending in `-express` only with the Express add-on), `agentyk-embedding-1.0` and `agentyk-reranker-1.0` (with the LLM plan), the voice and avatar ids used with `/v1/audio/speech` and `/v1/realtime` (with Agentyk Voice, Express or Avatar), and the transcription models (`agentyk-scribe-1.0` and `agentyk-scribe-urdu-1.0` for `POST /v1/audio/transcriptions`, `agentyk-scribe-live-1.0` for `/v1/realtime`) when your plan includes Agentyk Scribe.","security":[{"apiKey":[]}],"responses":{"200":{"description":"OpenAI-style model list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelList"}}}}}}},"/v1/embeddings":{"post":{"tags":["Inference"],"summary":"Create embeddings (OpenAI-compatible)","description":"OpenAI-compatible text embeddings via AgentykLM Embedding (model id agentyk-embedding-1.0): 1024-dim, multilingual, up to 32K context. Requires the agentyk-llm entitlement; reuse your existing agk_ API key.","security":[{"apiKey":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmbeddingRequest"}}}},"responses":{"200":{"description":"OpenAI embeddings response (data[].embedding = 1024-dim float vectors).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Embedding"}}}}}}},"/v1/rerank":{"post":{"tags":["Inference"],"summary":"Rerank documents (OpenAI/Cohere-compatible)","description":"Rerank documents against a query via AgentykLM Reranker (model id agentyk-reranker-1.0). Returns results sorted by relevance_score. Requires the agentyk-llm entitlement; reuse your existing agk_ API key.","security":[{"apiKey":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RerankRequest"}}}},"responses":{"200":{"description":"Rerank results sorted by descending relevance_score (index points into the input documents).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Rerank"}}}}}}},"/v1/knowledge/ingest/document":{"post":{"tags":["Knowledge"],"summary":"Ingest a document into your knowledge graph","description":"Mine atomic, source-cited claims from a document and write them to YOUR graph database. Send your graph DB connection in X-Graph-* headers: X-Graph-Endpoint (required, your SPARQL query URL), X-Graph-Update-Endpoint (for writes), X-Graph-Token + X-Graph-Auth-Type. We never store them. Requires the agentyk-llm entitlement.","security":[{"apiKey":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeIngestDocument"}}}},"responses":{"200":{"description":"Ingestion result.","content":{"application/json":{"schema":{"type":"object","properties":{}}}}}}}},"/v1/knowledge/ingest/file":{"post":{"tags":["Knowledge"],"summary":"Ingest a file of any type (PDF, Office, text, HTML, email, audio) into your knowledge graph","description":"Upload a document via multipart/form-data (field `file`, ≤10 MB). ANY supported format — PDF (scanned PDFs are OCR'd automatically), Word/Excel/PowerPoint (.docx/.xlsx/.pptx), plain text, Markdown, CSV, JSON, HTML, email (.eml/.msg), or audio (.wav/.mp3/… transcribed via Agentyk Scribe) — is parsed/transcribed in memory (nothing stored), mined for claims, and written to YOUR graph database. Ingestion is durable + resumable (see GET /v1/knowledge/ingest/status/{document_id}). Send your graph DB connection in X-Graph-* headers: X-Graph-Endpoint (required, your SPARQL query URL), X-Graph-Update-Endpoint (for writes), X-Graph-Token + X-Graph-Auth-Type. We never store them. Requires the agentyk-llm entitlement.","security":[{"apiKey":[]}],"responses":{"200":{"description":"Ingestion result.","content":{"application/json":{"schema":{"type":"object","properties":{}}}}}}}},"/v1/knowledge/ingest/files":{"post":{"tags":["Knowledge"],"summary":"Bulk-ingest files asynchronously (returns a job to poll)","description":"Upload one OR MANY files via multipart/form-data (repeat the `file` field; ANY supported format — PDF incl. scanned/OCR, Office .docx/.xlsx/.pptx, text, Markdown, CSV, JSON, HTML, email, audio). They are parsed/transcribed, mined for claims, and written to YOUR graph database in the BACKGROUND. Returns 202 with `{ job_id, status, files }` — poll GET /v1/knowledge/jobs/{job_id} for progress. Send your graph DB connection in X-Graph-* headers: X-Graph-Endpoint (required, your SPARQL query URL), X-Graph-Update-Endpoint (for writes), X-Graph-Token + X-Graph-Auth-Type. We never store them. Requires the agentyk-llm entitlement.","security":[{"apiKey":[]}],"responses":{"202":{"description":"Job accepted: { job_id, status, files }.","content":{"application/json":{"schema":{"type":"object","properties":{}}}}}}}},"/v1/knowledge/jobs/{job_id}":{"get":{"tags":["Knowledge"],"summary":"Poll the status of an async ingest job","description":"Return the status/progress of a bulk-ingest job started by POST /v1/knowledge/ingest/files (e.g. queued/running/done/failed, per-file results, counts). Send your graph DB connection in X-Graph-* headers: X-Graph-Endpoint (required, your SPARQL query URL), X-Graph-Update-Endpoint (for writes), X-Graph-Token + X-Graph-Auth-Type. We never store them. Requires the agentyk-llm entitlement.","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"job_id","in":"path"}],"responses":{"200":{"description":"Job status/progress.","content":{"application/json":{"schema":{"type":"object","properties":{}}}}}}}},"/v1/knowledge/ingest/status/{document_id}":{"get":{"tags":["Knowledge"],"summary":"Ingestion completeness for a document (durable manifest)","description":"Return the per-chunk ingestion manifest for a document — `{ total_chunks, done, failed, pending, claims_written, complete }` — read from YOUR graph database, so a corpus ingested over days/weeks can be audited document-by-document (never silently partial). `exists:false` when the document was never ingested through the resumable path. Send your graph DB connection in X-Graph-* headers: X-Graph-Endpoint (required, your SPARQL query URL), X-Graph-Update-Endpoint (for writes), X-Graph-Token + X-Graph-Auth-Type. We never store them. Requires the agentyk-llm entitlement.","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"document_id","in":"path"}],"responses":{"200":{"description":"Ingestion status.","content":{"application/json":{"schema":{"type":"object","properties":{}}}}}}}},"/v1/knowledge/ingest/resume/{document_id}":{"post":{"tags":["Knowledge"],"summary":"Resume a partially-ingested document to completion","description":"Re-drive an incomplete document. Send the SAME text as JSON `{ \"text\": \"…\" }`; the pipeline reads the manifest and processes ONLY the chunks not yet done (content-addressed → idempotent, never deletes committed chunks). Returns 202 + `{ job_id, status }`; poll GET /v1/knowledge/jobs/{job_id} and GET /v1/knowledge/ingest/status/{document_id}. Send your graph DB connection in X-Graph-* headers: X-Graph-Endpoint (required, your SPARQL query URL), X-Graph-Update-Endpoint (for writes), X-Graph-Token + X-Graph-Auth-Type. We never store them. Requires the agentyk-llm entitlement.","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"document_id","in":"path"}],"responses":{"202":{"description":"Resume job accepted: { job_id, status }.","content":{"application/json":{"schema":{"type":"object","properties":{}}}}}}}},"/v1/knowledge/parse":{"post":{"tags":["Knowledge"],"summary":"Parse a document to text (with OCR) — no ingestion, no storage","description":"Upload a document via multipart/form-data (field `file`); it is parsed + OCR'd (for scanned PDFs) to text and RETURNED as `{ text, title, chars }`. NOTHING is ingested or stored (read-only, zero-retention). Useful to OCR a scanned PDF and then feed the text to POST /v1/knowledge/ingest/document. Requires the agentyk-llm entitlement.","security":[{"apiKey":[]}],"responses":{"200":{"description":"Extracted text: { text, title, chars }.","content":{"application/json":{"schema":{"type":"object","properties":{}}}}}}}},"/v1/knowledge/ground":{"post":{"tags":["Knowledge"],"summary":"Grounded retrieval over your knowledge graph","description":"Retrieve claims relevant to a question, reranked, each traceable to its source span. Send your graph DB connection in X-Graph-* headers: X-Graph-Endpoint (required, your SPARQL query URL), X-Graph-Update-Endpoint (for writes), X-Graph-Token + X-Graph-Auth-Type. We never store them. Requires the agentyk-llm entitlement.","security":[{"apiKey":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeGround"}}}},"responses":{"200":{"description":"Grounding result with provenance.","content":{"application/json":{"schema":{"type":"object","properties":{}}}}}}}},"/v1/knowledge/ground/answer":{"post":{"tags":["Knowledge"],"summary":"Grounded answer: a cited natural-language answer over your knowledge graph","description":"Retrieve + rerank claims for a question (as /ground does), then synthesize a concise natural-language answer with inline [n] citations, each [n] mapping to one returned claim. Returns { answer, citations: [{ n, claim_iri, subject, predicate, object, ... }] }. If no supporting claims are found, returns a graceful no-evidence answer instead of guessing. Send your graph DB connection in X-Graph-* headers: X-Graph-Endpoint (required, your SPARQL query URL), X-Graph-Update-Endpoint (for writes), X-Graph-Token + X-Graph-Auth-Type. We never store them. Requires the agentyk-llm entitlement.","security":[{"apiKey":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeGroundAnswer"}}}},"responses":{"200":{"description":"Synthesized answer with citations.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeGroundAnswerResponse"}}}}}}},"/v1/knowledge/ingest/preview":{"post":{"tags":["Knowledge"],"summary":"Preview extraction (dry-run) — what would be accepted, nothing written","description":"Run extraction + the conformance/ontology gate over a document and return, per claim, whether it WOULD be accepted or rejected (and why) — WITHOUT writing anything to your graph. Use it to tune before bulk ingestion. Send your graph DB connection in X-Graph-* headers: X-Graph-Endpoint (required, your SPARQL query URL), X-Graph-Update-Endpoint (for writes), X-Graph-Token + X-Graph-Auth-Type. We never store them. Requires the agentyk-llm entitlement.","security":[{"apiKey":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeIngestPreview"}}}},"responses":{"200":{"description":"Preview: would_accept / would_reject + per-claim reasons.","content":{"application/json":{"schema":{"type":"object","properties":{}}}}}}}},"/v1/knowledge/ontology":{"get":{"tags":["Knowledge"],"summary":"The active controlled vocabulary (allowed predicates + entity types)","description":"Return the controlled predicates (with object-vs-literal typing), entity types, and a summary of the SHACL constraints the ingestion gate enforces — so you can see exactly what will be accepted. Requires the agentyk-llm entitlement.","security":[{"apiKey":[]}],"responses":{"200":{"description":"The active vocabulary.","content":{"application/json":{"schema":{"type":"object","properties":{}}}}}}}},"/v1/knowledge/claims":{"delete":{"tags":["Knowledge"],"summary":"Delete all claims for a document_id or collection","description":"Remove every claim (and its provenance graphs) for a `document_id` or `collection` from YOUR graph database (exactly one selector; needs X-Graph-Update-Endpoint). Never drops the whole store. Send your graph DB connection in X-Graph-* headers: X-Graph-Endpoint (required, your SPARQL query URL), X-Graph-Update-Endpoint (for writes), X-Graph-Token + X-Graph-Auth-Type. We never store them. Requires the agentyk-llm entitlement.","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"required":false,"name":"document_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"collection","in":"query"}],"responses":{"200":{"description":"Deletion counts.","content":{"application/json":{"schema":{"type":"object","properties":{}}}}}}}},"/v1/knowledge/collections/{collection}":{"delete":{"tags":["Knowledge"],"summary":"Delete all claims in a collection","description":"Remove every claim tagged with the given collection from YOUR graph database (needs X-Graph-Update-Endpoint). Send your graph DB connection in X-Graph-* headers: X-Graph-Endpoint (required, your SPARQL query URL), X-Graph-Update-Endpoint (for writes), X-Graph-Token + X-Graph-Auth-Type. We never store them. Requires the agentyk-llm entitlement.","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"collection","in":"path"}],"responses":{"200":{"description":"Deletion counts.","content":{"application/json":{"schema":{"type":"object","properties":{}}}}}}}},"/v1/knowledge/admin/canonicalize-predicates":{"post":{"tags":["Knowledge"],"summary":"Re-map minted predicates onto their schema.org IRI (maintenance)","description":"Re-map predicates that were minted BEFORE a standard mapping existed (e.g. `vocab#includes` / `vocab#website`) onto their schema.org IRI in YOUR graph, and prune the stale definition so future ingests resolve fresh — the curated mapping otherwise only fires at first mint. DRY-RUN by default (returns the plan, writes nothing); `?apply=true` writes (needs X-Graph-Update-Endpoint). `mode=rewrite` (default) rewrites claims; `mode=prune-only` drops stale defs WITHOUT rewriting (then DELETE + re-ingest for clean integrity hashes). Affects only your store. Send your graph DB connection in X-Graph-* headers: X-Graph-Endpoint (required, your SPARQL query URL), X-Graph-Update-Endpoint (for writes), X-Graph-Token + X-Graph-Auth-Type. We never store them. Requires the agentyk-llm entitlement.","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","description":"true to write; default false (dry-run)."},"required":false,"name":"apply","in":"query"},{"schema":{"type":"string","description":"rewrite (default) | prune-only."},"required":false,"name":"mode","in":"query"},{"schema":{"type":"string","description":"false to keep the stale defs (default true)."},"required":false,"name":"prune_defs","in":"query"}],"responses":{"200":{"description":"The plan (dry-run) or the applied counts.","content":{"application/json":{"schema":{"type":"object","properties":{}}}}}}}},"/v1/knowledge/admin/prune-orphan-entities":{"post":{"tags":["Knowledge"],"summary":"Reconcile the registry — remove orphaned entities (maintenance)","description":"Remove entity records in YOUR graph that no remaining claim references — the residue a pre-cascade delete, a crashed prune, or a race can leave behind. Every normal delete already cascades this automatically; run the sweep to reconcile historical drift or after a bulk operation. Returns `{pruned, remaining}` where `remaining` is the authoritative live entity count. Idempotent; needs X-Graph-Update-Endpoint; affects only your store. Send your graph DB connection in X-Graph-* headers: X-Graph-Endpoint (required, your SPARQL query URL), X-Graph-Update-Endpoint (for writes), X-Graph-Token + X-Graph-Auth-Type. We never store them. Requires the agentyk-llm entitlement.","security":[{"apiKey":[]}],"responses":{"200":{"description":"{ pruned, remaining } — count removed + live entity total.","content":{"application/json":{"schema":{"type":"object","properties":{}}}}}}}},"/v1/knowledge/sparql":{"post":{"tags":["Knowledge"],"summary":"Read-only SPARQL query over your knowledge graph","description":"Execute a read-only SPARQL 1.1 query (updates + federated SERVICE/LOAD are rejected). Send your graph DB connection in X-Graph-* headers: X-Graph-Endpoint (required, your SPARQL query URL), X-Graph-Update-Endpoint (for writes), X-Graph-Token + X-Graph-Auth-Type. We never store them. Requires the agentyk-llm entitlement.","security":[{"apiKey":[]}],"responses":{"200":{"description":"SPARQL results (JSON).","content":{"application/json":{"schema":{"type":"object","properties":{}}}}}}},"get":{"tags":["Knowledge"],"summary":"Read-only SPARQL query (GET) over your knowledge graph","description":"Read-only SPARQL via ?query=. Updates + federation rejected. Send your graph DB connection in X-Graph-* headers: X-Graph-Endpoint (required, your SPARQL query URL), X-Graph-Update-Endpoint (for writes), X-Graph-Token + X-Graph-Auth-Type. We never store them. Requires the agentyk-llm entitlement.","security":[{"apiKey":[]}],"responses":{"200":{"description":"SPARQL results (JSON).","content":{"application/json":{"schema":{"type":"object","properties":{}}}}}}}},"/v1/knowledge/provenance/{code}":{"get":{"tags":["Knowledge"],"summary":"Provenance chain for a claim","description":"Return the full provenance chain for a claim code. Send your graph DB connection in X-Graph-* headers: X-Graph-Endpoint (required, your SPARQL query URL), X-Graph-Update-Endpoint (for writes), X-Graph-Token + X-Graph-Auth-Type. We never store them. Requires the agentyk-llm entitlement.","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"code","in":"path"}],"responses":{"200":{"description":"Provenance chain.","content":{"application/json":{"schema":{"type":"object","properties":{}}}}}}}},"/v1/knowledge/verify/{code}":{"get":{"tags":["Knowledge"],"summary":"Verify a claim","description":"Return the verification status for a claim code. Send your graph DB connection in X-Graph-* headers: X-Graph-Endpoint (required, your SPARQL query URL), X-Graph-Update-Endpoint (for writes), X-Graph-Token + X-Graph-Auth-Type. We never store them. Requires the agentyk-llm entitlement.","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"code","in":"path"}],"responses":{"200":{"description":"Verification result.","content":{"application/json":{"schema":{"type":"object","properties":{}}}}}}}},"/v1/knowledge-open/ground":{"post":{"tags":["Knowledge Open"],"summary":"Retrieve grounded claims from Agentyk Knowledge Open","description":"Search the shared, verifiable open-science knowledge graph (CC-BY literature) for claims relevant to a question; returns claims with provenance. Uses YOUR Agentyk key; requires the agentyk-knowledge-open entitlement.","security":[{"apiKey":[]}],"responses":{"200":{"description":"Grounded claims.","content":{"application/json":{"schema":{"type":"object","properties":{}}}}}}}},"/v1/knowledge-open/ground/answer":{"post":{"tags":["Knowledge Open"],"summary":"One-call cited answer from Agentyk Knowledge Open","description":"Retrieve from the public-science corpus AND synthesize a cited answer in one call. Uses YOUR Agentyk key; requires the agentyk-knowledge-open entitlement.","security":[{"apiKey":[]}],"responses":{"200":{"description":"Answer + citations.","content":{"application/json":{"schema":{"type":"object","properties":{}}}}}}}},"/v1/knowledge-open/sparql":{"post":{"tags":["Knowledge Open"],"summary":"Read-only SPARQL against Agentyk Knowledge Open","description":"Run a read-only SPARQL query against the public-science corpus. Uses YOUR Agentyk key; requires the agentyk-knowledge-open entitlement.","security":[{"apiKey":[]}],"responses":{"200":{"description":"SPARQL results.","content":{"application/json":{"schema":{"type":"object","properties":{}}}}}}}},"/v1/knowledge-open/provenance/{code}":{"get":{"tags":["Knowledge Open"],"summary":"Provenance chain for an Open claim","description":"The full provenance chain for a claim in the public-science corpus. Uses YOUR Agentyk key; requires the agentyk-knowledge-open entitlement.","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"code","in":"path"}],"responses":{"200":{"description":"Provenance chain.","content":{"application/json":{"schema":{"type":"object","properties":{}}}}}}}},"/v1/knowledge-open/verify/{code}":{"get":{"tags":["Knowledge Open"],"summary":"Re-verify an Open claim (integrity + signature)","description":"Re-verify a claim's content-addressed integrity (and Ed25519 signature) in the public-science corpus. Uses YOUR Agentyk key; requires the agentyk-knowledge-open entitlement.","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"code","in":"path"}],"responses":{"200":{"description":"Verification result.","content":{"application/json":{"schema":{"type":"object","properties":{}}}}}}}},"/v1/knowledge-open/ontology":{"get":{"tags":["Knowledge Open"],"summary":"The Agentyk Knowledge Open controlled vocabulary","description":"The controlled predicate/type vocabulary of the public-science corpus. Uses YOUR Agentyk key; requires the agentyk-knowledge-open entitlement.","security":[{"apiKey":[]}],"responses":{"200":{"description":"Ontology.","content":{"application/json":{"schema":{"type":"object","properties":{}}}}}}}},"/v1/usage":{"get":{"tags":["Usage"],"summary":"Your usage and cost by day and product","description":"Returns the calling tenant's own usage (requests, fresh and cached input tokens, output tokens, audio minutes) and the cost charged in EUR, grouped by day and/or product. `format=csv` returns CSV. At most 186 days per call.","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","description":"ISO 8601 start (inclusive). Default: `to` minus 30 days."},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","description":"ISO 8601 end (exclusive). Default: now."},"required":false,"name":"to","in":"query"},{"schema":{"type":"string","description":"IANA time zone for day buckets, e.g. Europe/Amsterdam. Default UTC."},"required":false,"name":"tz","in":"query"},{"schema":{"type":"string","enum":["day","model","day_model"],"description":"Default day_model."},"required":false,"name":"groupBy","in":"query"},{"schema":{"type":"string","enum":["json","csv"]},"required":false,"name":"format","in":"query"}],"responses":{"200":{"description":"Rows + totals; CSV when format=csv.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/V1UsageBreakdown"}}}}}}},"/v1/realtime":{"get":{"tags":["Realtime"],"summary":"Realtime sessions over WebSocket (live transcription, voice, avatar)","description":"WebSocket endpoint for the realtime products. Connect to `wss://api.agentyk.xyz/v1/realtime?model=<id>`. Control messages are JSON text frames; audio and video are binary frames. Authenticate on the handshake with `Authorization: Bearer agk_...`, or, from a browser (which cannot set headers on a WebSocket), with the subprotocols `agentyk.v1` and `agentyk-key.agk_...`. The key is never accepted as a query parameter.\n\n**Models.** `agentyk-scribe-live-1.0` (live transcription; `agentyk-scribe` entitlement), `agentyk-voice-1.0` and `agentyk-voice-express-1.0` (streaming speech synthesis; `agentyk-voice`), `agentyk-avatar-1.0` (talking-head video; `agentyk-avatar`). `GET /v1/models` lists the ones available to your key.\n\n**Admission.** A session holds capacity for its whole duration. When none is free the server sends `{\"type\":\"busy\",\"retry_after_ms\":N}` instead of `ready` and closes; retry after the delay. Errors arrive as `{\"type\":\"error\",\"code\":\"...\",\"message\":\"...\"}` and end the session. Gateway codes: `unknown_model`, `unauthorized`, `forbidden`, `unavailable`, `too_many_sessions`, `upstream_gone`, `invalid_priority`.\n\n**Priority.** Add `priority=batch` to the URL for background work such as pre-rendering clips. A batch session starts only when capacity is free, and it is ended as soon as a live session needs that capacity: it receives `{\"type\":\"preempted\",\"retry_after_ms\":N}` and the socket closes with code 1013; retry after the delay. Media produced until then is billed as for any other session. A live session (no `priority`, or `priority=live`) never waits for a batch session; two live sessions, or two batch sessions, compete exactly as before (`busy`). Any other value is refused with `invalid_priority`.\n\n### Live transcription (`agentyk-scribe-live-1.0`)\n1. Read before you write: the first frame may be `busy`.\n2. Send `start`: `{\"type\":\"start\",\"language\":\"de\",\"refine\":true}`. Fields: `language` (ISO 639-1 or `auto`, default `auto`), `refine` (default false; revised text, see below), `sample_rate` (8000, 16000, 22050, 24000, 32000, 44100 or 48000; default 16000), `format` (`pcm_s16le` default, or `pcm_f32le`), `channels` (1 or 2; stereo is down-mixed), `diarize` (default false; speaker labels, needs the speaker-labels add-on, otherwise `ready.diarize` is false and the session runs unlabelled), `final_labels` (with `diarize`, default false; an end-of-session re-check of every speaker turn, delivered as a `speakers` frame at `stop`).\n3. Send raw PCM as binary frames, 20 to 100 ms each, at real time (at most 1 MiB per frame). Keep sending silence during breaks; it costs nothing.\n4. Send `{\"type\":\"stop\"}`. The server flushes the remaining text, then sends `done` and closes.\n\nFrames you receive: `ready` (the accepted settings), `partial` (provisional text, replaces the previous partial), `final` (committed text), `utterance` (with `refine`: the finished utterance re-decoded with full context, replacing its finals), `transcript` (with `refine`, at `stop`: the whole session re-decoded, batch accuracy), `speakers` (with `diarize` and `final_labels`, at `stop`: the re-checked speaker timeline `{pass:\"final\", supersedes:\"all\", speakers, turns:[{speaker,start,end}]}`; apply it over the labels you hold, the text is unchanged), `done` (`audio_ms`, `utterances`, `reason` = `stop`, `no_speech` or `max_duration`; with labels also `speakers` and `final_pass`), `busy`, `error`. Times are seconds from the start of the session's audio.\n\n**Speaker labels.** With `diarize`, `partial` and `final` frames carry a `speaker` number (a final is split where the speaker changes; `speaker_provisional: true` marks a label that may still change), and `utterance` / `transcript` carry `turns`. Up to **8 speakers**, both while live and in the end-of-session re-check. With `final_labels`, `stop` waits for the re-check, typically well under a minute.\n\n**Limits and billing.** Sessions run up to 8 hours and end on their own, transcript included, after 30 minutes without speech; 60 seconds without any frame from the client ends a session with `idle_timeout`. Error codes from the session: `protocol_error`, `bad_request`, `unsupported_language`, `unavailable`, `upstream_error`, `too_fast`, `idle_timeout`, `not_reading`, `shutting_down`, `too_many_sessions`. Metered per audio second consumed (`done.audio_ms`); the 10-second minimum of batch transcription does not apply.\n\n### Voice and Avatar\nSend `start` (Voice: `language`, `format`; Avatar: `image`, `audio_source` = `text` or `pcm`, `video_size` = 256, 320, 384 or 512, optional `voice_model`), then `text` frames (and `flush` at the end of an utterance, `cancel` to barge in, `stop` to close). Every binary media frame is preceded by a JSON `chunk` frame describing it (`seq`, `kind`, `bytes`, `pts_ms`, `duration_ms`). Voice audio is PCM s16le, 24 kHz, mono; Avatar video is fragmented MP4 of about one second per chunk. `done` ends each utterance. Sessions are capped at 30 minutes.","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","description":"`agentyk-scribe-live-1.0`, `agentyk-voice-1.0`, `agentyk-voice-express-1.0` or `agentyk-avatar-1.0`.","example":"agentyk-scribe-live-1.0"},"required":true,"name":"model","in":"query"},{"schema":{"type":"string","enum":["live","batch"],"description":"`live` (default) or `batch`: background work that yields its capacity to live sessions (see Priority).","example":"batch"},"required":false,"name":"priority","in":"query"}],"responses":{"101":{"description":"Switching protocols: the WebSocket session starts. Everything after this is frames, described above."}}}},"/v1/decisions":{"post":{"tags":["Decision"],"summary":"Answer yes/no, choice and score questions about a text, with probabilities","description":"Agentyk Decision reads a text and answers your questions about it: yes or no, a choice from your own options, or a score on your own scale. Every answer comes with a probability for each option, so you set your own thresholds. All questions are answered in one fast pass and no text is generated, so a short message typically comes back in under a second.\n\n**Access.** Decision is an account add-on, enabled per account on request: contact support to have it switched on. Without it this endpoint returns 403, and `GET /v1/models` does not list the Decision models for your key. Authenticate with your `agk_` key as on every other endpoint.\n\n**Models.** `agentyk-decision-1.0` (the default; the most accurate) and `agentyk-decision-flash-1.0` (faster, for high volumes). Both take the same request and return the same shapes.\n\n**Questions.** Send 1 to 16 questions in one request, each under an id you choose (1 to 64 characters). Every question reads the whole input. The answers come back under the same ids.\n- `yes_no`: optional `yes` and `no` describe what each answer means. Returns `answer` (true or false) and `probability`, the probability of yes; `answer` is true when `probability` is at least 0.5.\n- `choice`: `options` is an array of 1 to 255 `{key, description?}` entries with distinct keys; the order you send is kept. Returns `answer` (the most probable key), `probabilities` (one per key) and `confidence`.\n- `score`: `levels` is an array of 2 to 10 distinct labels, lowest first. Returns `answer` (the most probable level), `probabilities` (one per level), `score` (the expected level position, from 0 for the first level to n - 1 for the last; 1.3 means between the second and third level) and `confidence`.\n\n`question` is optional on every type but makes answers better. `confidence` runs from 0 (all options equally likely) to 1 (certain). Input is text: send a string, or a JSON object such as a data record, which is read as its JSON text. Images and video are not supported yet (400). The body may be at most 1 MB.\n\n**Errors for one question.** If one question cannot be answered, its slot holds `{\"error\": {\"code\", \"message\"}}` and the other questions are still answered. Codes: `input_too_long` (the input with this question is too long for the model; nothing is ever truncated), `invalid_question`, `model_error` (retry that question). The response is still 200; only answered questions are billed.\n\n**Errors for the request.** 400 invalid body (the message names the field), 401 no or invalid key, 403 the add-on is not enabled for this account, 404 unknown model, 429 `concurrency_limit` (at most 4 requests in flight per account; retry after `Retry-After` seconds) or `over_capacity` (the service is busy; retry after `Retry-After`), 503 temporarily unavailable, 502 or 504 retry shortly.\n\n**Billing.** EUR 0.03 per million billed input tokens; output is free. `usage.prompt_tokens` counts the tokens read over all answered questions (each question reads the whole input, plus its own question and options); `usage.billed_tokens` is what is charged: `prompt_tokens`, with a minimum of 120 per request. `usage.input_tokens` is the size of the input alone. Each billed request costs at least EUR 0.00001, the smallest amount the ledger records. Volume discounts apply as for other usage. A request that fails, or in which no question was answered, costs nothing.\n\n**curl**\n```bash\ncurl https://api.agentyk.xyz/v1/decisions \\\n  -H \"Authorization: Bearer $AGENTYK_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"agentyk-decision-1.0\",\n    \"input\": \"The parcel arrived broken and nobody answers my emails.\",\n    \"questions\": {\n      \"complaint\": {\"type\": \"yes_no\", \"question\": \"Is this a complaint?\"},\n      \"topic\": {\"type\": \"choice\", \"question\": \"What is it mainly about?\",\n                \"options\": [{\"key\": \"delivery\"}, {\"key\": \"billing\"}, {\"key\": \"product_quality\"},\n                            {\"key\": \"customer_service\", \"description\": \"how staff respond\"}]},\n      \"anger\": {\"type\": \"score\", \"question\": \"How angry is the writer?\",\n                \"levels\": [\"calm\", \"annoyed\", \"angry\", \"furious\"]}\n    }\n  }'\n```\n\n**Python**\n```python\nimport os, requests\n\nr = requests.post(\n    \"https://api.agentyk.xyz/v1/decisions\",\n    headers={\"Authorization\": f\"Bearer {os.environ['AGENTYK_API_KEY']}\"},\n    json={\n        \"model\": \"agentyk-decision-1.0\",\n        \"input\": \"The parcel arrived broken and nobody answers my emails.\",\n        \"questions\": {\n            \"complaint\": {\"type\": \"yes_no\", \"question\": \"Is this a complaint?\"},\n            \"topic\": {\n                \"type\": \"choice\",\n                \"question\": \"What is it mainly about?\",\n                \"options\": [\n                    {\"key\": \"delivery\"},\n                    {\"key\": \"billing\"},\n                    {\"key\": \"product_quality\"},\n                    {\"key\": \"customer_service\", \"description\": \"how staff respond\"},\n                ],\n            },\n            \"anger\": {\n                \"type\": \"score\",\n                \"question\": \"How angry is the writer?\",\n                \"levels\": [\"calm\", \"annoyed\", \"angry\", \"furious\"],\n            },\n        },\n    },\n    timeout=60,\n)\nr.raise_for_status()\nanswers = r.json()[\"answers\"]\n\nif answers[\"complaint\"][\"probability\"] > 0.9:\n    print(\"complaint about\", answers[\"topic\"][\"answer\"], \"| mood:\", answers[\"anger\"][\"answer\"])\n```","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecisionRequest"}}}},"responses":{"200":{"description":"The answers, one per question id. A question that could not be answered carries an `error` instead.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecisionResponse"}}}},"400":{"description":"Invalid body: the message names the field. Also for `images` / `videos` (not supported yet) and bodies over 1 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecisionError"}}}},"401":{"description":"No API key, or an invalid one.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecisionError"}}}},"403":{"description":"The Decision add-on is not enabled for this account. It is enabled per account on request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecisionError"}}}},"404":{"description":"Unknown or unavailable model.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecisionError"}}}},"429":{"description":"`concurrency_limit`: at most 4 requests in flight per account. `over_capacity`: the service is busy. Retry after `Retry-After` seconds.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecisionError"}}}},"502":{"description":"The service could not answer; retry shortly.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecisionError"}}}},"503":{"description":"Temporarily unavailable; retry after `Retry-After` seconds.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecisionError"}}}},"504":{"description":"The request timed out; retry shortly.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecisionError"}}}}}}}},"webhooks":{}}