# Building apps with Core Agent

Use this document when the desired outcome is a working application rather than a single API call.

## Build

Give the agent the outcome, constraints, and acceptance checks. The agent works in its durable workspace, runs the project, and returns a live preview.

```text
Build a mobile-first support dashboard. Use the existing repository,
run its tests, and give me a live preview before publishing.
```

## Add Core services

When the project needs inference or capabilities, approve **Use Core** in the environment request. Core creates a project-scoped `core_sk_` and stores it outside the repository and conversation.

Server-side application routes:

| Route | Purpose |
|---|---|
| `POST /api/ai/chat` | Model messages. |
| `POST /api/ai/<capability>` | Search, images, speech, research, or another routed capability. |
| `GET /api/ai/status` | Check whether Core is configured. |

Do not call paid Core services from browser code and do not commit credentials.

## Preview and publish

1. Ask the agent to start the application.
2. Validate the live preview.
3. Give corrections in the same task.
4. Ask the agent to publish after acceptance checks pass.

The preview and published service receive secrets as server-side configuration; keys are not copied into build artifacts.

## Related

- [Core Agent](https://docs.core.so/core-agent.md)
- [Model router and project keys](https://docs.core.so/api-keys-and-inference.md)
