> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pipecorn.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Pipecorn SDK and client libraries

> Pipecorn has no language SDK. Call the REST API with any HTTP client, or generate a typed client in your language from the Pipecorn OpenAPI spec.

Pipecorn does not publish a language-specific SDK. The API is plain JSON over HTTPS with an API key in a header, so the HTTP client you already use works. When you want typed methods, generate a client from the OpenAPI spec.

| You want to | Use |
| - | - |
| Call the API from backend code | Any HTTP client, or a client generated from the OpenAPI spec |
| Run Pipecorn from a shell script, cron job or CI | The [Pipecorn CLI](https://docs.pipecorn.com/cli/overview.md) |
| Give an AI assistant or agent access to Pipecorn | The [Pipecorn MCP server](https://docs.pipecorn.com/mcp/overview.md) |

## Call the API directly

Every request sends your [API key](https://docs.pipecorn.com/api-reference/API-key.md) in the `X-API-KEY` header. This reads your credit balance, which costs nothing:

```bash cURL theme={null}
curl https://app.pipecorn.com/api/v2/credits \
  -H "X-API-KEY: $PIPECORN_API_KEY"
```

```javascript Node.js theme={null}
const res = await fetch("https://app.pipecorn.com/api/v2/credits", {
  headers: { "X-API-KEY": process.env.PIPECORN_API_KEY },
});
console.log(await res.json());
```

```python Python theme={null}
import os
import requests

res = requests.get(
    "https://app.pipecorn.com/api/v2/credits",
    headers={"X-API-KEY": os.environ["PIPECORN_API_KEY"]},
)
print(res.json())
```

```ruby Ruby theme={null}
require "net/http"
require "json"

uri = URI("https://app.pipecorn.com/api/v2/credits")
req = Net::HTTP::Get.new(uri, "X-API-KEY" => ENV.fetch("PIPECORN_API_KEY"))
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(req) }
puts JSON.parse(res.body)
```

## Generate a typed client from the OpenAPI spec

The whole API is described in one OpenAPI 3 file, [`https://docs.pipecorn.com/openapi.json`](https://docs.pipecorn.com/openapi.json), also served at [`https://pipecorn.com/openapi.json`](https://pipecorn.com/openapi.json). Every operation has an `operationId`, so generators produce readable method names such as `enrichASinglePerson` or `searchLeadsByFilters`.

With [OpenAPI Generator](https://openapi-generator.tech):

```bash theme={null}
npx @openapitools/openapi-generator-cli generate \
  -i https://docs.pipecorn.com/openapi.json \
  -g typescript-fetch \
  -o ./pipecorn-client
```

Change `-g` to `python`, `go`, `ruby`, `java` or `csharp` for another language. Regenerate when the [changelog](https://docs.pipecorn.com/changelog.md) announces a new endpoint.

A generated client does not know Pipecorn's conventions. Handle these yourself:

* [Rate limits](https://docs.pipecorn.com/essentials/rate-limiting.md): read the `RateLimit-*` headers and wait for `Retry-After` on a `429`.
* [Retries and idempotency](https://docs.pipecorn.com/essentials/idempotency.md): send an `Idempotency-Key` on every `POST` so a retry never charges twice.
* [Async results](https://docs.pipecorn.com/essentials/async-results.md): poll the `Location` URL that async enrichment returns.
* [Pagination](https://docs.pipecorn.com/essentials/pagination.md): pass `next_cursor` back as `cursor`.
* [Credit and limit errors](https://docs.pipecorn.com/api-reference/errors.md): a `402` means the credit balance is empty.

## Pipecorn CLI

The `pipecorn` command wraps the REST API with JSON, CSV or table output and structured exit codes:

```bash theme={null}
npm install -g @pipecorn/cli
```

See the [CLI overview](https://docs.pipecorn.com/cli/overview.md) and the [command reference](https://docs.pipecorn.com/cli/commands.md).

## Pipecorn MCP server

AI assistants and agents connect at `https://mcp.pipecorn.com/mcp` with OAuth (`Authorization: Bearer <access token>`) or an API key in the `X-API-Key` or `X-Workspace-Key` header, never in `Authorization`. See the [MCP overview](https://docs.pipecorn.com/mcp/overview.md) for setup in Claude, ChatGPT, Claude Code and Cursor.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.