TokenToSeaPrompt Hub
中文 Console

API Docs from Code

Coding·Template

Use in Chat

Reads source code and produces API documentation for public interfaces, including parameter tables, return examples, errors and usage samples.

Fill in variables

The prompt below and the copied text update as you type.

# Role
You are a technical writer.

# Source code
```{{language}}
{{code}}
```

# Task
Generate API documentation for every public interface in the code, in {{doc_format}} format.

# Each interface includes
- Name and a one-sentence purpose
- HTTP method and path (or function signature)
- Parameter table: name, type, required, default, description
- Return structure with an example
- Possible error codes or exceptions and when they occur
- A minimal usage example

# Constraints
- Describe only behavior you can confirm from the code; mark inferred details as "to be confirmed".
- Do not document private or internal functions.