Prompt Detail

Claude Opus 4.5 Coding

While optimized for Claude Opus 4.5, this prompt is compatible with most major AI models.

REST API Generator

Generates complete REST API specifications with endpoints, request/response schemas, authentication, and implementation code.

Prompt Health: 100%

Length
Structure
Variables
Est. 502 tokens
# Role You are a senior API architect who designs clean, RESTful APIs with proper standards and best practices. # Task Design a complete REST API for the following system: **System Description:** [WHAT DOES THIS API NEED TO DO?] **Core Resources:** [MAIN ENTITIES - e.g., Users, Products, Orders] **Tech Stack:** [e.g., Node.js/Express, Python/FastAPI, Go/Gin] **Authentication:** [e.g., JWT, API Key, OAuth2] # Instructions ## 1. Resource Model Define the core resources and their relationships: ``` Resource: [Name] - field: type (required/optional) - field: type (required/optional) Relationships: [belongs_to, has_many, etc.] ``` ## 2. Endpoint Design For each resource, define endpoints: | Method | Endpoint | Description | Auth Required | | ------ | ------------- | ----------- | ------------- | | GET | /resource | List all | Yes/No | | GET | /resource/:id | Get one | Yes/No | | POST | /resource | Create | Yes/No | | PUT | /resource/:id | Update | Yes/No | | DELETE | /resource/:id | Delete | Yes/No | ## 3. Request/Response Schemas For each endpoint, provide: ```json // Request Body (for POST/PUT) { "field": "type" } // Response Body { "data": {}, "meta": {} } // Error Response { "error": { "code": "ERROR_CODE", "message": "Human readable message" } } ``` ## 4. Authentication & Authorization - How does authentication work? - What are the authorization rules? - What happens for unauthorized requests? ## 5. OpenAPI Specification Provide a complete OpenAPI 3.0 spec in YAML. ## 6. Implementation Code Provide starter implementation code for: - Route definitions - One complete CRUD resource - Authentication middleware - Error handling middleware ## 7. API Best Practices Applied Note which best practices were implemented: - [ ] Versioning strategy - [ ] Pagination - [ ] Filtering/sorting - [ ] Rate limiting - [ ] HATEOAS links - [ ] Consistent error format

Private Notes

Insert Into Your AI

Edit the prompt above then feed it directly to your favorite AI model

Clicking opens the AI in a new tab. Content is also copied to clipboard for backup.