# Chat

Chat with Cuppa AI research agent

## Chat with Cuppa AI agent

> Send messages to Cuppa AI agent with access to research tools.\
> The agent can research keywords, analyze competitors, check SERP data, and provide content strategy insights.\
> Requires Power plan or higher.<br>

```json
{"openapi":"3.1.0","info":{"title":"Cuppa API","version":"1.0.0"},"tags":[{"name":"Chat","description":"Chat with Cuppa AI research agent"}],"servers":[{"url":"https://api.cuppa.ai"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-KEY"}}},"paths":{"/v1/chat/completions":{"post":{"summary":"Chat with Cuppa AI agent","description":"Send messages to Cuppa AI agent with access to research tools.\nThe agent can research keywords, analyze competitors, check SERP data, and provide content strategy insights.\nRequires Power plan or higher.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["messages"],"properties":{"messages":{"type":"array","items":{"type":"object","required":["role","content"],"properties":{"role":{"type":"string","enum":["user","assistant","system"]},"content":{"type":"string"}}},"minItems":1},"site_id":{"type":"string","format":"uuid","description":"Site ID for brand context. If not provided, uses first active site."},"model":{"type":"string","default":"gpt-5-mini","description":"The model to use for chat"},"tools":{"type":"array","items":{"type":"string","enum":["research_keywords","analyze_serp","get_striking_distance","cluster_keywords","get_articles","get_brand_context","get_site_pages","get_gsc_performance","analyze_competitor_keywords"]},"description":"Which tools to enable. Defaults to all tools."},"max_tokens":{"type":"integer","minimum":100,"maximum":16000,"default":4000}}}}}},"responses":{"200":{"description":"Chat completion response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"object","properties":{"role":{"type":"string","enum":["assistant"]},"content":{"type":"string"}}},"tool_calls":{"type":"array","description":"Tools that were called during the conversation","items":{"type":"object","properties":{"tool":{"type":"string"},"input":{"type":"object"},"output":{"type":"object"},"success":{"type":"boolean"}}}},"usage":{"type":"object","properties":{"prompt_tokens":{"type":"integer"},"completion_tokens":{"type":"integer"},"total_tokens":{"type":"integer"}}},"model":{"type":"string"}}}}}}},"tags":["Chat"]}}}}
```


---

# Agent Instructions: 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:

```
GET https://learn.cuppa.ai/rest-api/chat.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
