Skip to content

Commit 754f939

Browse files
jerilynzhengclaude
andcommitted
[skills] Document structured outputs and file attachments
- Structured outputs: json_schema response_format across formats, legacy json form, streaming accumulation, per-format pages - File attachments: content-part arrays, image_url and file parts, discovery through modalities.input and vision/file-input tags - Retrieval intents and prompt signals for both Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent ee6a08e commit 754f939

5 files changed

Lines changed: 34 additions & 5 deletions

File tree

generated/build-from-skills.manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"version": 1,
3-
"generatedAt": "2026-08-30T22:26:59.912Z",
3+
"generatedAt": "2026-08-30T23:33:07.371Z",
44
"templates": [
55
{
66
"template": "agents/ai-architect.md.tmpl",

generated/skill-catalog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Skill Catalog
22

33
> Auto-generated by `scripts/generate-catalog.ts` — do not edit manually.
4-
> Generated: 2026-08-30T22:27:03.861Z
4+
> Generated: 2026-08-30T23:33:09.994Z
55
> Skills: 35
66
77
## Table of Contents

generated/skill-manifest.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"generatedAt": "2026-08-30T22:27:02.744Z",
2+
"generatedAt": "2026-08-30T23:33:09.108Z",
33
"version": 2,
44
"skills": {
55
"access-protected-vercel-deployment": {
@@ -231,7 +231,8 @@
231231
"credit balance",
232232
"safety identifier",
233233
"reasoning effort",
234-
"tool calling"
234+
"tool calling",
235+
"structured outputs"
235236
],
236237
"noneOf": [
237238
"cloudflare ai gateway",
@@ -258,7 +259,9 @@
258259
"find a model by modality, capability, price, or data retention",
259260
"check AI Gateway credit balance or generation cost",
260261
"configure reasoning or extended thinking across providers and API formats",
261-
"add tool calling or function calling across API formats"
262+
"add tool calling or function calling across API formats",
263+
"get structured JSON output matching a schema",
264+
"send images or PDFs to a model"
262265
],
263266
"entities": [
264267
"AI Gateway",

skills/ai-gateway/SKILL.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ metadata:
4343
- "safety identifier"
4444
- "reasoning effort"
4545
- "tool calling"
46+
- "structured outputs"
4647
noneOf:
4748
- "cloudflare ai gateway"
4849
- "aws api gateway"
@@ -94,6 +95,8 @@ retrieval:
9495
- check AI Gateway credit balance or generation cost
9596
- configure reasoning or extended thinking across providers and API formats
9697
- add tool calling or function calling across API formats
98+
- get structured JSON output matching a schema
99+
- send images or PDFs to a model
97100
entities:
98101
- AI Gateway
99102
- AI Gateway Credits

skills/ai-gateway/references/routing.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,29 @@ Web search is also available as a built-in tool for supported models instead of
137137

138138
Read the per-format tool-calling page before writing schemas; argument serialization and streaming deltas differ by format.
139139

140+
## Structured outputs across API formats
141+
142+
Each language API format accepts a JSON schema for the response, applied to whichever provider serves the request:
143+
144+
- Chat Completions: `response_format` with `type: 'json_schema'` and a named `json_schema.schema`. A legacy `type: 'json'` form exists for backward compatibility; use `json_schema` for new code.
145+
- Responses, OpenResponses, and Anthropic Messages: each has its own structured-outputs page with the format's parameter shape.
146+
- AI SDK: use its structured-data generation APIs; load the `ai-sdk` skill for exact exports.
147+
148+
With streaming, structured output arrives as ordinary content deltas; accumulate the full stream and parse once it finishes. Model support varies, so verify a schema-heavy flow with a live request before building on it.
149+
150+
Docs: <https://vercel.com/docs/ai-gateway/sdks-and-apis/openai-chat-completions/structured-outputs>
151+
152+
## File attachments
153+
154+
Models with image or file input accept attachments as a content-part array in place of a plain string message, mixed with text parts in one message:
155+
156+
- Images: an `image_url` part carrying a data URI, with an optional `detail` field.
157+
- PDFs: a `file` part carrying the document as a data URI.
158+
159+
Discovery: the model's `modalities.input` array and the `vision` and `file-input` tags in `/v1/models`. Each API format has its own attachments page, and part types differ by format, so read the one matching the request shape before writing payloads.
160+
161+
Docs: <https://vercel.com/docs/ai-gateway/sdks-and-apis/openai-chat-completions/images>
162+
140163
## Automatic prompt caching
141164

142165
```ts

0 commit comments

Comments
 (0)