Endpoint response snippet

View as Markdown

Use the <EndpointResponseSnippet> component to reference an endpoint response from your API Reference.

Usage

Response
1{
2 "turns": [
3 {
4 "role": "user",
5 "content": "Can you explain the benefits of using Claude-4.5-sonnet for natural language processing tasks?"
6 },
7 {
8 "role": "assistant",
9 "content": "Claude-4.5-sonnet offers enhanced contextual understanding and improved coherence in generated text, making it ideal for complex NLP applications such as summarization, translation, and conversational AI."
10 }
11 ],
12 "citations": [
13 "https://www.anthropic.com/claude-4.5-sonnet-release-notes",
14 "https://arxiv.org/abs/2306.12345"
15 ]
16}
Markdown
1<EndpointResponseSnippet endpoint="POST /chat/{domain}" />

Reference particular examples

1

Set the example name in your spec

openapi.yml
1paths:
2 /pet/{petId}:
3 put:
4 summary: Get a pet
5 operationId: pets_get
6 responses:
7 '200':
8 content:
9 application/json:
10 schema:
11 $ref: '#/components/schemas/Pet'
12 examples:
13 ExampleWithMarkley:
14 summary: This is an example of a Pet
15 value:
16 name: Markley
17 id: 44
pets.yml
1service:
2 auth: true
3 base-path: ""
4 endpoints:
5 update:
6 docs: Get a pet
7 method: GET
8 path: /pet/{petId}
9 response: Pet
10 examples:
11 - name: ExampleWithMarkley
12 docs: This is an example of a Pet
13 response:
14 body:
15 name: Markley
16 id: 44
2

Directly reference the example

Markdown
1 <EndpointResponseSnippet
2 endpoint="GET /pet/{petId}"
3 example="ExampleWithMarkley"
4 />