> ## Documentation Index
> Fetch the complete documentation index at: https://docs.b3os.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Caddie and Contracts

Use Caddie workflow chat and smart contract generation, testing, deployment, and verification endpoints.

| Method   | Endpoint                                                                                                 | Description                                                                                                                                                                                                                                      |
| -------- | -------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `GET`    | [/v1/ai/workflow/chat/history](/api/reference/get-v1-ai-workflow-chat-history)                           | Get chat history for a conversation, workflow, or session                                                                                                                                                                                        |
| `POST`   | [/v1/ai/workflow/chat/messages](/api/reference/post-v1-ai-workflow-chat-messages)                        | Persist one chat message \(caddie records V3 turns in chat history\)                                                                                                                                                                             |
| `GET`    | [/v1/ai/workflow/chat/sessions](/api/reference/get-v1-ai-workflow-chat-sessions)                         | List chat sessions for the current organization                                                                                                                                                                                                  |
| `GET`    | [/v1/ai/workflow/chat/snapshot](/api/reference/get-v1-ai-workflow-chat-snapshot)                         | Get the live/pending state of a conversation \(refresh-resume\): whether a turn is actively running, the pending interrupt card, and the current mode. Excludes the transcript \(use /chat/history\) and the canvas \(use the workflow record\). |
| `POST`   | [/v1/ai/workflow/chat/stream](/api/reference/post-v1-ai-workflow-chat-stream)                            | Stream AI chat for workflow generation and updates via SSE                                                                                                                                                                                       |
| `POST`   | [/v1/ai/workflow/chat/usage](/api/reference/post-v1-ai-workflow-chat-usage)                              | Report one chat turn's LLM usage \(caddie V3\) for AI-Credit billing                                                                                                                                                                             |
| `POST`   | [/v1/contract](/api/reference/post-v1-contract)                                                          | Create a new contract project                                                                                                                                                                                                                    |
| `DELETE` | [/v1/contract/&#123;id&#125;](/api/reference/delete-v1-contract-id-)                                     | Delete a contract project by ID                                                                                                                                                                                                                  |
| `GET`    | [/v1/contract/&#123;id&#125;](/api/reference/get-v1-contract-id-)                                        | Get a contract project by ID                                                                                                                                                                                                                     |
| `PUT`    | [/v1/contract/&#123;id&#125;](/api/reference/put-v1-contract-id-)                                        | Update a contract project                                                                                                                                                                                                                        |
| `POST`   | [/v1/contract/&#123;id&#125;/audit](/api/reference/post-v1-contract-id-audit)                            | Run audit for a contract project                                                                                                                                                                                                                 |
| `POST`   | [/v1/contract/&#123;id&#125;/deploy/approve](/api/reference/post-v1-contract-id-deploy-approve)          | Approve and initiate contract deployment to testnet or mainnet                                                                                                                                                                                   |
| `GET`    | [/v1/contract/&#123;id&#125;/download](/api/reference/get-v1-contract-id-download)                       | Download contract project as Foundry ZIP                                                                                                                                                                                                         |
| `POST`   | [/v1/contract/&#123;id&#125;/fix](/api/reference/post-v1-contract-id-fix)                                | Trigger AI auto-fix for a contract with failed tests                                                                                                                                                                                             |
| `POST`   | [/v1/contract/&#123;id&#125;/plan/approve](/api/reference/post-v1-contract-id-plan-approve)              | Approve a contract plan to proceed with code generation                                                                                                                                                                                          |
| `POST`   | [/v1/contract/&#123;id&#125;/test](/api/reference/post-v1-contract-id-test)                              | Run tests for a contract project                                                                                                                                                                                                                 |
| `GET`    | [/v1/contract/&#123;id&#125;/verification-status](/api/reference/get-v1-contract-id-verification-status) | Check verification status for all deployments of a contract project                                                                                                                                                                              |
| `POST`   | [/v1/contract/chat/stream](/api/reference/post-v1-contract-chat-stream)                                  | Stream AI chat for smart contract development via SSE                                                                                                                                                                                            |
| `GET`    | [/v1/contract/projects/&#123;id&#125;/stream](/api/reference/get-v1-contract-projects-id-stream)         | Stream contract project events                                                                                                                                                                                                                   |
| `GET`    | [/v1/contract/session/&#123;sessionId&#125;](/api/reference/get-v1-contract-session-session-id-)         | Get a contract project by session ID                                                                                                                                                                                                             |
| `GET`    | [/v1/contracts](/api/reference/get-v1-contracts)                                                         | List contract projects for the organization                                                                                                                                                                                                      |
| `POST`   | [/v1/contracts/&#123;id&#125;/verify](/api/reference/post-v1-contracts-id-verify)                        | Verify a deployed contract's source code on block explorer \(Etherscan, Basescan, etc.\)                                                                                                                                                         |