Skip to content

Commit 6a2d8d8

Browse files
committed
docs(integrations): add Mastra and Pi examples
1 parent a855c34 commit 6a2d8d8

8 files changed

Lines changed: 3008 additions & 0 deletions

File tree

‎README.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,12 @@ published launch checks are complete.
165165

166166
## Examples
167167

168+
Framework integrations: [Mastra](integrations/mastra/README.md) has a runnable
169+
agent using an account-selected text model; [Pi](integrations/pi/README.md)
170+
has a user-managed OpenAI Responses provider configuration.
171+
The separately maintained [Pi BeatAPI Provider](https://github.com/BeatAPI/pi-beatapi-provider)
172+
offers a GitHub-installable extension with a scoped three-model catalog.
173+
168174
| Example | cURL | Node.js | Python |
169175
| --- | --- | --- | --- |
170176
| Search and inspect capabilities | [`capabilities.sh`](examples/curl/capabilities.sh) | [`capabilities.mjs`](examples/node/capabilities.mjs) | [`capabilities.py`](examples/python/capabilities.py) |

‎integrations/mastra/README.md‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# BeatAPI with Mastra
2+
3+
This example gives a Mastra agent one BeatAPI text model through the
4+
OpenAI-compatible Chat Completions route. It uses an explicit AI SDK provider;
5+
it does not add BeatAPI to Mastra's built-in model router or list every BeatAPI
6+
capability in Mastra Studio.
7+
8+
## Run
9+
10+
Requires Node.js 22.13 or later.
11+
12+
```bash
13+
cd integrations/mastra
14+
npm ci
15+
export BEATAPI_API_KEY="<your private BeatAPI key>"
16+
curl https://api.beatapi.io/v1/models \
17+
-H "Authorization: Bearer $BEATAPI_API_KEY"
18+
export BEATAPI_MODEL="<an enabled text model ID from the response>"
19+
npm start -- "Summarize what an industrial agent should check before acting."
20+
```
21+
22+
The API key remains in the local process. Mastra sends the prompt to BeatAPI's
23+
`POST /v1/chat/completions`; this can consume BeatAPI credits. For reasoning,
24+
tools, and other model-specific features, verify the exact model and request
25+
contract before relying on them in an agent workflow.
26+
27+
`npm run check` verifies the TypeScript integration. A successful type check is
28+
not proof of a live model call; run the example with your own account-enabled
29+
model to verify that path.

0 commit comments

Comments
 (0)