multi-router.aidocs

Prompts

Managing Prompts

The Prompts page, who can change prompts, limits, and the prompt API.

Prompts are managed on the Prompts page in the dashboard and through the prompt endpoints of the API. The Prompts page lists every inline and GitHub prompt in the organization, shows which routers use each one, and flags GitHub files that failed to sync.

The Prompts page

Engineering · org_7Tq2Wd9KxP

All prompts· Inline & GitHub Managed

Save viewNew Prompt
Source:
AllInlineGitHub
Filters
Search name, path…
Prompts
7
Inline
4
GitHub
3
Bound routers
4
Unused
3
Errored
1
Prompts
1–7 of 725 / page
Columns
Updated
NameStatusTagsBound toUpdated
escalation-policy.md
example-co/prompts·main·4e8a1c2
synced
supportAdd tag
Escalations
rt_3Pn8Tc6WdF
25 min ago
refund-examples.json
example-co/prompts·main·9b3d7f0
synced
supportAdd tag
unbound25 min ago
support-triage
ip_6Rt2Kw9QmD
rev 3
supportAdd tag
Support bot
rt_9Hk3Ws7PzQ
3 days ago
refund-classifier
ip_8Jd4Fv1XnB
rev 2
supportbillingAdd tag
Refunds
rt_8Mc5Jx3VbN
5 days ago
sql-helper
ip_3Ys7Gp5MwH
rev 4
analyticsAdd tag
Analytics
rt_7Vb4Qm2HsK
8 days ago
legacy-faq.md
example-co/prompts·main·1c5e9a4
error
supportAdd tag
unbound12 days ago
onboarding-email
ip_5Hc9Lr2TzA
rev 1
marketingAdd tag
unbound21 days ago
The Prompts page: views, stat tiles, and inline and GitHub prompts with their status, tags and the routers they are bound to. Select to enlarge.

The Prompts page opens from Prompts in the top navigation. Tiles across the top count the organization's prompts under Prompts, Inline, GitHub, Bound routers, Unused and Errored, where Bound routers counts the prompts bound to at least one router. The table lists one prompt per row with these columns, which the Columns menu shows or hides:

ColumnShows
NameThe prompt name, or the file name of a GitHub prompt with its repository and path on hover.
Statussynced, pending or error for a GitHub prompt.
TagsThe labels on the prompt. A GitHub prompt shows its prompt repo's tags.
Bound toThe routers the prompt is bound to.
UpdatedWhen the prompt last changed.

The side rail offers built-in views, and any filtered list can be saved under My views with Save view:

ViewLists
All promptsEvery prompt in the organization.
InlineInline prompts.
GitHub ManagedGitHub prompts.
Recently changedPrompts changed in the last 7 days.
Sync errorsGitHub prompts whose last fetch failed.
UnusedPrompts bound to no router.

The list can be filtered further:

FilterValues
SourceAll, Inline or GitHub.
StatusAny, Synced, Pending or Error.
Bound toAny, A router or Unbound.
GitHub repositoryOne connected prompt repo.
TagsOne or more tags.

The New Prompt menu creates an inline prompt, connects a repository from a connected GitHub organization, connects a new GitHub organization, and opens Manage GitHub orgs. See Inline Prompt and GitHub Prompt.

Access

Every member of an organization can create, edit and delete inline prompts, connect and disconnect prompt repos, and track files. Connecting and disconnecting a GitHub organization requires an organization admin, because it grants Multi-Router access to that organization's repositories. Binding a prompt to a router is part of changing the router. API keys reach prompts through the scopes below.

ScopeAllows
prompts:readListing and reading prompts and their revisions.
prompts:writeCreating and editing inline prompts.
prompts:deleteDeleting inline prompts.
prompt_repos:readListing and reading prompt repos and their files.
prompt_repos:writeConnecting prompt repos and tracking files.
prompt_repos:deleteDisconnecting prompt repos and untracking files.
github:readListing GitHub connections.
github:deleteDisconnecting GitHub organizations.

Limits

Prompts and prompt repos have the following limits:

ItemLimit
Prompt name80 characters
Revision title200 characters
Inline prompt content, text or chat128 KiB
Chat prompt messages64
GitHub prompt file2 MiB, at the latest commit or pinned
Revisions returned by the APIThe 100 most recent
Requests that check GitHub, per organization60 per minute
Prompt repo name80 characters
Prompt repos per organization200
Tracked files per prompt repo1,000
File paths per request100
File path512 characters
Branch name250 characters

Prompt API

The prompt endpoints cover inline prompts, GitHub prompts, prompt repos and GitHub connections:

EndpointDescription
GET /v1/promptsLists prompts.
POST /v1/promptsCreates an inline prompt.
GET /v1/prompts/{id}Reads one prompt, including its body and variables.
PATCH /v1/prompts/{id}Changes an inline prompt, saving a new revision when the body changes.
DELETE /v1/prompts/{id}Deletes an inline prompt and its revisions.
GET /v1/prompts/{id}/versionsLists revisions or commits, newest first.
GET /v1/prompts/{id}/versions/{version}Reads one revision or commit, including its body.
POST /v1/prompts/{id}/versions/{version}/restoreMakes an earlier inline revision current.
GET /v1/prompts/{id}/routersLists the routers bound to the prompt.
POST /v1/prompt-reposConnects a repository and branch, and tracks files.
GET /v1/prompt-reposLists prompt repos.
GET /v1/prompt-repos/{id}Reads one prompt repo.
PATCH /v1/prompt-repos/{id}Renames a prompt repo.
DELETE /v1/prompt-repos/{id}Disconnects a prompt repo.
GET /v1/prompt-repos/{id}/filesLists tracked files.
POST /v1/prompt-repos/{id}/filesTracks one more file.
DELETE /v1/prompt-repos/{id}/filesStops tracking the file named in the path query parameter.
GET /v1/prompt-repos/{id}/commitsLists the branch's commits, optionally for one file.
GET /v1/github/connectionsLists connected GitHub organizations.
GET /v1/github/connections/{login}Reads one GitHub connection.
DELETE /v1/github/connections/{login}Disconnects a GitHub organization.

Prompts, prompt repos and model groups also have tags endpoints. See Prompts in the API Reference for scopes, conditional writes and errors. GET /v1/prompts returns a page of prompts in data, with next_cursor and has_more for paging. It accepts these query parameters:

ParameterDescription
sourceinline or github.
typetext or chat.
prompt_repo_idOnly the GitHub prompts of one prompt repo.
limitPrompts per page, from 1 to 200. The default is 50.
cursorThe next_cursor of the previous page.

A GitHub prompt read with GET /v1/prompts/{id} carries its repository details:

GET /v1/prompts/pf_cHJfWGI1TnEyTHc4VC9wcm9tcHRzL3N1cHBvcnQtdHJpYWdlLm1kjson
{
  "organization_id": "org_7Tq2Wd9KxP",
  "data": {
    "id": "pf_cHJfWGI1TnEyTHc4VC9wcm9tcHRzL3N1cHBvcnQtdHJpYWdlLm1k",
    "object": "prompt",
    "source": "github",
    "name": "prompts/support-triage.md",
    "type": "text",
    "body": "You are a support agent for {{product}}.\n\nClassify the customer's message as billing, technical or account, then answer in {{language}}.",
    "variables": ["product", "language"],
    "version": "3f9c2a7e1b4d8065c2e9a17f0b3d5c8e6a4f2b19",
    "github": {
      "prompt_repo_id": "pr_Xb5Nq2Lw8T",
      "repo": "example-co/prompts",
      "branch": "main",
      "file_path": "prompts/support-triage.md",
      "current_sha": "3f9c2a7e1b4d8065c2e9a17f0b3d5c8e6a4f2b19",
      "status": "synced"
    }
  }
}

Prompts in Traffic

Traffic records the prompt and revision each request used. See Prompts in Traffic on the overview and Observability.

Prompt BindingOverview
Was this helpful?