# API contract — prompt for ChatGPT

Describe an HTTP method from the requirements, separating agreed fields from decisions still to be made.

Canonical URL: https://boswidget.ru/en/api-contract-prompt-for-chatgpt/

Model: ChatGPT

Category: Code

Tags: API, contract, documentation

![API contract](https://boswidget.ru/assets/images/text-preview-chatgpt-api-contract-1200.851d941134c6.webp)

API contract

## Prompt

Draft an HTTP API contract for this task: {task}. Agreed rules and data: {rules}. Give the method and path, request and response field tables with types, required status and constraints, one successful-response example and error cases. Distinguish agreed details from proposals. Do not add unnecessary personal data, secrets or real tokens. Finish by listing decisions to agree before implementation. Check that examples match the stated types.

## Template fields

- `{task}` — Method's purpose. Example input: What the customer must do and which result they should obtain
- `{rules}` — Rules and data. Example input: Fields, constraints, access and known errors

## Launch

[Open ChatGPT in YesAI](https://yesai.su/en/chatgpt)
