This endpoint is the same as the openAI API, but it uses context to improve the results. See

Context Control

The only difference in the request params is that you can manage matched context items with max_matches, max_total_matches_tokens, max_single_match_tokens and min_match_relevancy_score

Filter context using tags

You can use the tags and tags_exlude params to only find context item matches that have/don't have the specifiec tags.

Context Placement

By default the relevant context will be prepended to the prompt. If you need more fine grained control you can include the string [context] within the prompt and the context will be added inline.

Context Items Prompt

By default Godly will use the prompt to retrieve relevant context items. However if you engineer your prompt it could include some language confuses the semantic search. To improve accuracy you can pass the original request with the context_search_prompt param and Godly will use that for context item search.


The only difference to OpenAI in the response is that it returns matches which is an array of context items that were used in the prompt (or context_search_prompt). You can use this for debugging or improving the user experience by providing reference responses.

Click Try It! to start a request and see the response here!