# Wizard API

{% hint style="info" %}
Chat API has been deprecated in favor of the [#aikek-wizard](https://docs.alphakek.ai/launch/universal-agents#aikek-wizard "mention"), the new method of delivering AIKEK [universal-agents](https://docs.alphakek.ai/launch/universal-agents "mention") and [fractal](https://docs.alphakek.ai/fractal "mention") 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](https://docs.alphakek.ai/developers/api-pricing "mention").

{% content-ref url="api-usage-examples" %}
[api-usage-examples](https://docs.alphakek.ai/developers/api-usage-examples)
{% endcontent-ref %}
