Spec extensions and naming¶
Use this when the spec alone doesn't give oryva what you want, such as a package name, pagination or agent hints, or when a generated name surprises you. Every extension is optional: a spec without any of them still generates a complete SDK.
| Where | Extension | Meaning |
|---|---|---|
info |
x-oryva-name |
Package stem, e.g. ledger. Default: snake_case of the title's first word, skipping "The", "A" or "An". |
info |
x-oryva-idempotency-header |
Header for automatic idempotency keys, e.g. Idempotency-Key. |
info |
x-oryva-webhook-signing: standard-webhooks |
Webhooks are signed per standardwebhooks.com. |
info |
x-oryva-gateway |
Hosted mode for the MCP server: sign_in (scheme, or a mapping of schemes sent together to their field labels, label, help, and optionally connect: url of your app's sign-in-and-approve page, exchange operationId that trades {grant} for the credential with no auth, credential dotted path into its response), identity (operation, display), bind (parameter → dotted path into the identity response), tools.tags. Settings come from ORYVA_GATEWAY_SECRET, ORYVA_GATEWAY_URL and ORYVA_GATEWAY_CONNECT_URL (overrides connect.url); see Hosted mode. |
info |
x-oryva-chat |
A Slack app for hosted mode; needs x-oryva-gateway. See below. |
| server | x-oryva-name |
Environment name. Default: first label of the host, then environment_<n> on collision. |
| security scheme | x-oryva-env |
The environment variable an API key or token is read from; the client argument is its name without <NAME>_, in lower case. |
| operation | x-oryva-resource, x-oryva-method |
Override the derived names. A dotted resource (customers.notes) is nested under its parent in Python, TypeScript, Go, Java, Kotlin and C#. |
| operation | x-oryva-agent |
read_only, destructive, idempotent, hint, examples. |
| operation | x-oryva-pagination |
style: cursor (param, next_cursor, items), style: offset (offset_param, limit_param, items) or style: page (page_param, items). Paths are lists of field names. |
x-oryva-chat¶
A Slack app beside the hosted server. Each person connects their own account once; from then on the app acts as them. It sends one message a day with the best few new items, each with a button that deals with it in Slack, and Undo; urgent items go out at once. Its Home tab shows what is waiting, progress and what they finished this week. Claude answers their DMs with the hosted tools.
x-oryva-chat:
name: Tickets
feed:
operation: tickets_list_open # a hosted tool that needs only bound inputs
items: data
total: meta.total
every: 15m
priority: {field: severity, order: [p1, p2, p3], urgent: [p1]}
digest:
at: "09:00"
days: weekdays
limit: 3
prefer: one_click
group: queue.name
header: "{count} tickets to close in {group}."
finished: "All done. {left} more are waiting when you have time."
card:
id: id
title: subject
text: summary
context: customer.name
link: url
preview: {before: suggestion.before, after: suggestion.after}
apply:
when: one_click
label: suggestion.label
choices: suggestion.choices
operation: tickets_apply_suggestion
args: {ticketId: "{id}"}
done: "{result.label}"
undo: {operation: tickets_revert_suggestion, args: {ticketId: "{id}"}, done: Reverted.}
actions:
- {label: Snooze a day, operation: tickets_snooze, args: {ticketId: "{id}", days: 1}, done: Snoozed until tomorrow.}
home:
stats:
- operation: queues_health
items: data
title: name
progress: {done: answered, of: total, label: "{answered} of {total} answered"}
action:
when: overdue
label: "Escalate {overdue}"
operation: queues_escalate
args: {queueId: "{id}"}
done: "Escalated {result.count} tickets."
ask:
instructions: You help support agents with their queue.
prompts: [What is overdue?, Summarise today's p1s]
Paths are dotted field names from the root of an item (or a row, for home.stats). Text marked
"template" may hold {path}s into the item; done texts may also hold {result.path}s into what
the call returned. Every key is checked against the spec, and an error names the key.
name: the app's name, at most 35 characters.feed: a list operation's items, sent to each person.operation,items(path to the list in the response), optionallytotal(path to the full count, when the list returns a first page),every(30s,15m,1h: how often the app looks for urgent items and for whose digest is due).priority:field(path),order(values, first to last; others come after), and optionallyurgent(values whose items go out at once, each on its own).digest, every key optional:at(HH:MMin each person's Slack time zone, default09:00; people change theirs on the Home tab),days(daily, the default,weekdays, or a list such as[mon, thu]),limit(cards per message, 1 to 10, default 3),prefer(path to a flag: those items first),group(path: one digest holds items of one group, the group of the best item),header(template with{count}and{group}, default{count} waiting for you.),finished(replaces the header once every card is dealt with:{count},{group},{left}). A digest goes out once a day atat, and only when something is new. On connecting, the first digest is the welcome.card: paths toidandtitle, and optionallytext,context,link(opened by Open) andpreview(before,after, shown asbefore → after).apply, optional, the card's main button:operation,args(a value of"{path}"comes from the item),done(template), and optionallywhen(path to a flag: other items get Open as their main button),label(path to the button's label; for items that can't be applied, to the Open button's),choices(path to[{label, value}]: one button each, which sends its value as the operation'schoiceinput) andundo(operation,args,done, optionallylabel). An applied card turns into itsdonetext with Undo; a 409 from the operation says the item changed since it was found and keeps Open.actions, optional, at most 5, under the card's More menu:label(template),operation,args,done, and optionallywhen.
home.stats, optional: rows on the Home tab, each from a list operation:operation,items,title(path), optionallyprogress(doneandofpaths, drawn as a bar, and alabeltemplate) andaction(as underactions; its button shows wherewhenholds). A finished digest offers the first stat action whosewhenholds.ask, optional:instructionsfor Claude, andprompts, questions offered as buttons the first time someone opens the app's messages (at most 75 characters each). Claude asks before calling a tool that changes something.
feed, ask or both are required. Settings come from SLACK_CLIENT_ID and SLACK_CLIENT_SECRET
(people sign in with Slack before they connect, and any workspace adds the app at
/slack/install), SLACK_BOT_TOKEN (a workspace without /slack/install),
SLACK_APP_TOKEN or SLACK_SIGNING_SECRET, SLACK_API_URL, ORYVA_CHAT_DB (a SQLite file, or a
Postgres URL that several instances share), ANTHROPIC_API_KEY and ORYVA_CHAT_MODEL; see
Environment variables. The generated
slack-manifest.json asks for chat:write and im:write, im:history with ask, and
users:read with feed, for each person's time zone, and for the user scope openid, for Sign in
with Slack.
Naming¶
How oryva derives names from a spec. Every language applies its own casing to the same names.
- Resource: the operation's first tag in snake_case; with no tag, the first static path segment.
- Model: the
components.schemaskey in PascalCase. A key already in PascalCase keeps its spelling (GrowthURLs). - Method:
operationIdin snake_case with a leading<resource>_stripped (customers_listunder tagcustomers→list). With nooperationId: GET on a path ending in a parameter →get, other GET →list, POST →create, PUT/PATCH →update, DELETE →delete. Two operations mapping to the same resource+method is a parse error naming both. oryva.ymlcan set the same names per operation, and rename models, without editing the spec; see oryva.yml.- Path parameters: the path's last parameter is passed by position, the others by name: in Python
client.projects.keys.get("key_1", project_id="proj_1"), in TypeScriptclient.projects.keys.get('key_1', { project_id: 'proj_1' }). - Go names
createandretrieveNewandGet(create_variation→NewVariation), as Stainless's Go SDKs do. Params types take the resource in the singular:CustomerNewParamsin Go,CustomerCreateParamsin Java and Kotlin; Go adds a nested resource's parents (ChatCompletionNewParams), Java and Kotlin only when another resource has the same name. - Hoisted inline objects: request bodies →
<Resource><Method>Request, 2xx responses →<Resource><Method>Response, nested inline objects →<Parent><Field>(all PascalCase). - Agent defaults: GET →
read_only+idempotent; PUT →idempotent; DELETE →destructive+idempotent; POST/PATCH → none.x-oryva-agentkeys override individually. - Env vars, with
<NAME>the upper snake API name: webhooks<NAME>_WEBHOOK_SECRET; base URL<NAME>_BASE_URL. Credentials, when the API has one auth scheme: API key and http token<NAME>_API_KEY; basic auth<NAME>_USERNAME/<NAME>_PASSWORD; OAuth2<NAME>_CLIENT_ID/<NAME>_CLIENT_SECRET/<NAME>_OAUTH_TOKEN_URL. With several schemes, each gets its own, with<IDENT>the scheme's key in upper snake case:<NAME>_<IDENT>,<NAME>_<IDENT>_USERNAME,<NAME>_<IDENT>_CLIENT_ID,<NAME>_<IDENT>_TOKEN_URLand so on. Two schemes that would share a variable are a parse error. - Credential arguments: the env var without
<NAME>_, in the language's case (service_key=,service_key:in Ruby,serviceKey, with TypeScript's token URLs ending inURL); a single OAuth2 scheme's token URL istoken_url=/token_url:/tokenURL/tokenUrlin PHP. - Webhook ident: the event name in snake_case with dots as underscores (
invoice.paid→invoice_paid). - Client class: PascalCase API name in Python (
Ledger, asyncAsyncLedger), TypeScript, Java and Kotlin;LedgerClientin C#, where a class can't share its namespace's name;Clientin Go, Rust, Ruby and PHP, where the package, crate, module or namespace already names the API (ledger.Client,Ledger::Client,Ledger\Client). The Python and TypeScript targets'clientoption renames it. Resources are attributes (client.customers.list(...)), camelCase in TypeScript. Python keywords get a trailing underscore (from_); a Python parameter named like a request option getsapi_in front (api_timeout). - TypeScript models are exported from the package and also reachable on the client's namespace
(
Ledger.Customer). - MCP tool names:
<resource>_<method>(customers_list).