---
title: "Run an AI tool"
method: POST
path: "/ai/tools/{slug}"
tags: ["AI Tools"]
---

# Run an AI tool

`POST /ai/tools/{slug}`

## Request

- Base URL: `https://socialbu.com/api/v1`
- URL: `https://socialbu.com/api/v1/ai/tools/{slug}`
- Auth: HTTP bearer

Executes an AI tool by its slug and returns the generated content.

## Path parameters

- `slug` string, required

## Request body

- object
  - `team_id` integer, nullable: Team ID (optional). If provided, content is generated under the team.

## Response `200`

AI tool executed successfully. Returns the generated content.

- object: The response shape varies by tool, but always includes the credit cost of the request.
  - `credit_cost` integer: Number of AI credits consumed by this request (e.g. 1 for text tools, 30 for image tools).

## Other responses

- `400`: Invalid tool slug or bad request parameters.
- `403`: AI credit limit reached or insufficient permissions.
- `422`: Validation error - required fields missing or invalid.
- `429`: Rate limit exceeded.

---

[API](https://skmtc.dev/socialbu/apis/socialbu-api.md) · [All operations](https://skmtc.dev/socialbu/apis/socialbu-api/llms.txt) · [OpenAPI document](https://skmtc.dev/socialbu/apis/socialbu-api/revisions/841b3ab0f671?raw)
