# api4ai — Pipedream Connect

> api4ai offers a multitude of ready-to-use AI APIs to extract information from your images.

- API slug: `api4ai` (use in MCP headers and tool keys)
- Auth: API key (Pipedream-managed)
- Categories: Artificial Intelligence (AI)
- Website: https://api4.ai/
- This page (HTML): https://pipedream.com/apps/api4ai
- Tools: 7 actions · 0 triggers

## Connect via MCP (recommended)

- Endpoint: `https://remote.mcp.pipedream.net/v3`
- Headers: `Authorization: Bearer <token>` · `x-pd-project-id` · `x-pd-environment` · `x-pd-external-user-id` · `x-pd-app-slug: api4ai`

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "api4ai",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// e.g. run Alcohol Label Recognition:
const result = await mcp.callTool({
  name: "api4ai-alcohol-label-recognition",
  arguments: {
    image: "Image",
    syncDir: "SyncDir",
  },
})
```

Docs: [MCP guide](https://pipedream.com/docs/connect/mcp/developers.md)

## API proxy

For a api4ai endpoint with no pre-built tool, the proxy forwards your request with the connected user's credentials attached.

```bash
# The path segment is the target URL, URL-safe base64 encoded:
# https://general-detection.p.rapidapi.com/v1/algos

curl "https://api.pipedream.com/v1/connect/{project_id}/proxy/aHR0cHM6Ly9nZW5lcmFsLWRldGVjdGlvbi5wLnJhcGlkYXBpLmNvbS92MS9hbGdvcw?external_user_id={external_user_id}&account_id=apn_xxxxxxx" \
  -H "Authorization: Bearer {access_token}" \
  -H "x-pd-environment: production"
```

Docs: [API proxy guide](https://pipedream.com/docs/connect/api-proxy.md)

## SDK

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "api4ai-alcohol-label-recognition",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    api4ai: { authProvisionId: "apn_xxxxxxx" },
    image: "Image",
    syncDir: "SyncDir",
  },
})
```

Docs: [Managed auth guide](https://pipedream.com/docs/connect/managed-auth/quickstart.md) · [Tools guide](https://pipedream.com/docs/connect/components.md)

## Actions (7)

### `api4ai-alcohol-label-recognition` — Alcohol Label Recognition (Write)

Accurately identifies alcohol labels using advanced intelligent technologies. Powered by API4AI.

Full schema: https://pipedream.com/apps/api4ai/actions/alcohol-label-recognition.md

### `api4ai-background-removal` — Background Removal (Write)

Automatically and quickly remove image background with high accuracy. Powered by API4AI.

Full schema: https://pipedream.com/apps/api4ai/actions/background-removal.md

### `api4ai-brand-recognition` — Brand Recognition (Read-only)

The service processes input image and responds with a list of found brand logos. Powered by API4AI.

Full schema: https://pipedream.com/apps/api4ai/actions/brand-recognition.md

### `api4ai-car-image-background-removal` — Car Image Background Removal (Write)

Remove Background for car images. Powered by API4AI.

Full schema: https://pipedream.com/apps/api4ai/actions/car-image-background-removal.md

### `api4ai-furniture-and-household-item-recognition` — Furniture & Household Item Recognition (Write)

This API provides identification of furniture & household items with advanced intelligent detection, categorization, and counting technologies. Powered by API4AI.

Full schema: https://pipedream.com/apps/api4ai/actions/furniture-and-household-item-recognition.md

### `api4ai-image-anonymization` — Image Anonymization (Write)

Performs actual image anonymization. Powered by API4AI.

Full schema: https://pipedream.com/apps/api4ai/actions/image-anonymization.md

### `api4ai-nsfw-image-recognition` — NSFW Image Recognition (Write)

Content moderation solution for NSFW (Not Safe For Work) sexual images identification. Powered by API4AI.

Full schema: https://pipedream.com/apps/api4ai/actions/nsfw-image-recognition.md

---

- All apps: https://pipedream.com/apps — index: https://pipedream.com/llms.txt
- Pipedream docs for agents: https://pipedream.com/docs/llms.txt
