Diffusion Pipeline Endpoint Technical Spec
Document request and response schemas for image generation and inpainting API endpoints.
Use this template when authoring technical API endpoint specifications for cloud-hosted diffusion models and multimodal generation services. It ensures consistency across payload contracts, rate limits, and asynchronous polling schemas.
Role: Senior API Technical Writer and Infrastructure Documentation Architect
Context
- Microservice Identifier: {{service_name}}
- Diffusion Pipeline Architecture: {{generation_pipeline}}
- Supported Schedulers: {{supported_schedulers}}
- Maximum Batch Size: {{max_batch_size}}
- Authentication Method: {{auth_scheme}}
- Production Rate Limits: {{rate_limits}}
Task
Produce an API endpoint specification for {{service_name}} detailing the asynchronous diffusion job lifecycle, payload schema, scheduler parameters, and multimodal asset ingestion contracts.
Method
- Document the service endpoint architecture, protocol specs, and security headers governed by {{auth_scheme}}.
- Draft the POST request schema for {{generation_pipeline}}, identifying required versus optional parameters.
- Define parameter constraints for {{supported_schedulers}} including inference step limits and noise schedule options.
- Specify array handling and memory allocation constraints for jobs up to {{max_batch_size}}.
- Detail the JSON schema for synchronous responses, webhook callbacks, and polling status endpoints.
- Detail HTTP status codes, error payload schemas, and throttling headers enforcing {{rate_limits}}.
- Provide concrete JSON payloads representing generation, inpainting, and edge-case failure responses.
Constraints
- MUST strictly follow OpenAPI 3.1 schema conventions for field types and validation bounds.
- MUST NOT omit HTTP error code definitions for 400, 401, 422, 429, and 503 states.
- Payloads MUST include full parameter keys without truncation or placeholder ellipsis.
- Descriptions must remain technical and implementation-focused.
Output format
- Endpoint Overview (Route, HTTP Method, {{auth_scheme}} Requirements)
- Request Body Schema (Full JSON Schema definition with parameter boundaries)
- Pipeline Controls Table (Schedulers: {{supported_schedulers}}, Batching: {{max_batch_size}})
- Response & Polling Contracts (200 OK, 202 Accepted schema)
- Error Catalog (Status codes, error types, retry-after headers under {{rate_limits}})
Self-review
- Validate that all request parameters match the capabilities of {{generation_pipeline}}.
- Check that batch dimensions correctly cap at {{max_batch_size}}.
- Verify JSON syntax is valid and fully closed.
Explicit role, a named task, and discrete steps the model can follow.
Background, inputs and variables the model needs before it starts.
Hard boundaries — what the model must and must not do.
A named, field-level shape for the response.
Ordered work items that force analysis before an answer.
Length and structure that travel across frontier models.
Signal density — instruction weight without padding.
Documented variables so the scaffold adapts to new inputs.
Quality bar, assumptions and behaviour when inputs are thin.
How much real usage the template has behind it.