Prompt Detail

Claude Opus Coding

While optimized for Claude Opus, 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.

Authority Persona

Expert Note

API design prompts consistently rank among the most useful for backend developers. This pattern gained traction because it produces immediately usable specs rather than abstract advice. The inclusion of both OpenAPI spec and implementation code means developers can validate the design before committing to implementation. Particularly popular in startup environments where speed matters but quality can't be sacrificed.

Prompt Health: 100%

Length
Structure
Variables
Est. 507 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

Run Locally

Ollama not detected on localhost:11434