> ## 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](/cli/overview) |
| Give an AI assistant or agent access to Pipecorn | The [Pipecorn MCP server](/mcp/overview) |

## Call the API directly

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

<CodeGroup>
  ```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)
  ```
</CodeGroup>

## 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 `enrichPerson` 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](/changelog) announces a new endpoint.

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

* [Rate limits](/essentials/rate-limiting): read the `RateLimit-*` headers and wait for `Retry-After` on a `429`.
* [Retries and idempotency](/essentials/idempotency): send an `Idempotency-Key` on every `POST` so a retry never charges twice.
* [Async results](/essentials/async-results): poll the `Location` URL that async enrichment returns.
* [Pagination](/essentials/pagination): pass `next_cursor` back as `cursor`.
* [Credit and limit errors](/api-reference/errors): 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](/cli/overview) and the [command reference](/cli/commands).

## Pipecorn MCP server

AI assistants and agents connect at `https://mcp.pipecorn.com/mcp` with OAuth or an `X-API-Key` header. See the [MCP overview](/mcp/overview) for setup in Claude, ChatGPT, Claude Code and Cursor.


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