AI-Powered Note Generation

Generate community notes automatically using AI. The AI model analyzes the content and creates a note with relevant context and fact-checking information, including citations where possible.

Endpoint

POST /v1/ai

Generate and create a note using AI.

Request Body

The request body should be a JSON object with the following properties:

{
  "content_id": "string", // Required: ID of the content to analyze
  "content": "string"     // Required: The text content to analyze (max 2000 chars)
}

Response

Success Response (200 OK):

{
  "status": "created",
  "id": "note_id"
}

// Or when AI decides not to create a note:
{
  "status": "no_note",
  "message": "AI chose not to create a note."
}

Error Responses:

  • 400 Bad Request - Invalid input data

  • 401 Unauthorized - Invalid or missing API key

  • 500 Internal Server Error - Server error while generating note

Example

Request:

curl -X POST https://communitynotes.dev/v1/ai \
  -H "Authorization: Bearer your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "content_id": "post_123",
    "content": "Global temperatures have risen by 10 degrees in the last year..."
  }'

Success Response (Note Created):

{
  "status": "created",
  "id": "note_abc123"
}

Success Response (No Note Needed):

{
  "status": "no_note",
  "message": "AI chose not to create a note."
}

Notes

  • • The AI model will analyze the content and decide whether a note is needed

  • • If created, notes will include citations to support factual claims

  • • AI-generated notes are marked with Perplexity AI as the author

  • • Notes can still be voted on and will affect the content‘s credibility score

See Also