> For the complete documentation index, see [llms.txt](https://docs.alphakek.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.alphakek.ai/developers/wizard-api.md).

# Wizard API

{% hint style="info" %}
Chat API has been deprecated in favor of the [Universal Agents](/launch/universal-agents.md#aikek-wizard), the new method of delivering AIKEK [Universal Agents](/launch/universal-agents.md) and [Fractal](/fractal.md) data infra to builders.
{% endhint %}

## Knowledge Ask Json

> Answer a question using the Fractal knowledge engine.\
> \
> This endpoint returns a JSON object with \`answer\`, \`sources\`, and \`sentiment\` fields.\
> Sentiment is a domain-agnostic integer in the \[1, 10] range, where 1 is very negative\
> and 10 is very positive.

```json
{"openapi":"3.1.0","info":{"title":"FastAPI","version":"0.1.0"},"security":[{"HTTPBearer":[]}],"components":{"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}},"schemas":{"KnowledgeAskJSONPayload":{"properties":{"question":{"type":"string","title":"Question","description":"User question"},"search_mode":{"type":"string","enum":["deep","fast","ultrafast"],"title":"Search Mode","description":"Retrieval depth preset","default":"fast"}},"type":"object","required":["question"],"title":"KnowledgeAskJSONPayload","description":"Payload for the JSON-mode knowledge ask endpoint.\n\nAttributes\n----------\nquestion: str\n    The user's question to answer.\nsearch_mode: Literal[\"deep\", \"fast\", \"ultrafast\"]\n    Retrieval depth preset. Controls number of documents fetched."},"KnowledgeAskJSONResponse":{"properties":{"answer":{"type":"string","title":"Answer"},"sources":{"items":{"type":"string"},"type":"array","title":"Sources"},"sentiment":{"type":"integer","maximum":10,"minimum":1,"title":"Sentiment"}},"type":"object","required":["answer","sources","sentiment"],"title":"KnowledgeAskJSONResponse","description":"Response model for JSON-mode knowledge ask.\n\nAttributes\n----------\nanswer: str\n    Final answer text. Markdown is allowed.\nsources: list[str]\n    Deduplicated list of source URLs used for the answer.\nsentiment: int\n    Domain-agnostic sentiment on a 1–10 scale (1 very negative, 10 very positive)."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/knowledge/ask":{"post":{"tags":["knowledge"],"summary":"Knowledge Ask Json","description":"Answer a question using the Fractal knowledge engine.\n\nThis endpoint returns a JSON object with `answer`, `sources`, and `sentiment` fields.\nSentiment is a domain-agnostic integer in the [1, 10] range, where 1 is very negative\nand 10 is very positive.","operationId":"knowledge_ask_json_knowledge_ask_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeAskJSONPayload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeAskJSONResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

***

## Chat API Costs

Wizard API has a flat fee of 2 credits per request. Learn more about API Credits at [API Pricing](/developers/api-pricing.md).

{% content-ref url="/pages/rGRrhRvj2BZTVn8ueTRj" %}
[API Usage Examples](/developers/api-usage-examples.md)
{% endcontent-ref %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.alphakek.ai/developers/wizard-api.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
