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

# OpenAPI Client (Any Language)

> Generate HoneyHive REST API clients in any language from the public OpenAPI specs for serverless, polyglot, or regulated environments without vendor SDKs.

HoneyHive publishes [public OpenAPI specifications](https://github.com/honeyhiveai/honeyhive-openapi) that fully describe our REST APIs: a Data Plane spec (events, sessions, datasets, experiments - the API most integrations use) and a Control Plane spec (projects and alerts). Your platform team can use any open-source client generator to produce a lightweight, type-safe client in the language of their choice - no vendor-specific dependencies required.

<Card title="OpenAPI Specs (GitHub)" icon="github" href="https://github.com/honeyhiveai/honeyhive-openapi">
  Browse the full OpenAPI specifications.
</Card>

## Why Generate Your Own Client

Generated OpenAPI clients have no external dependencies beyond your language's standard HTTP libraries, making them ideal for:

* **Any language** - Go, Java, Ruby, Rust, C#, PHP, or any language with an OpenAPI generator
* **Serverless environments** - AWS Lambda, Google Cloud Functions, Azure Functions where package size matters
* **Regulated environments** - Industries with strict security requirements where adding dependencies is difficult
* **Full control** - Customize the generated code, extend it, or integrate it directly into your existing codebase

## Generating a Client

You can use any OpenAPI-compatible code generator. We recommend [OpenAPI Generator](https://openapi-generator.tech), which supports 50+ languages (Java, Go, Ruby, Rust, C#, PHP, and more).

### Example: Using OpenAPI Generator

First, install the [OpenAPI Generator CLI](https://openapi-generator.tech/docs/installation):

```bash theme={null}
npm install @openapitools/openapi-generator-cli -g
```

Then generate a Data Plane client in your preferred language. To generate a Control Plane client instead, swap `data_plane_openapi.yaml` for `control_plane_openapi.yaml`.

<Note>
  A Control Plane client authenticates differently than these Data Plane examples: it needs a fine-grained control-plane API key (values start with `hh_fgcp_`) sent as `Authorization: Bearer`, against `https://api.cp.us.honeyhive.ai`. See [Authorization](/v2/control-plane-sdk-reference/typescript#authorization).
</Note>

<CodeGroup>
  ```bash Go theme={null}
  openapi-generator-cli generate \
    -i https://raw.githubusercontent.com/honeyhiveai/honeyhive-openapi/main/data_plane_openapi.yaml \
    -g go \
    -o ./honeyhive-go-sdk
  ```

  ```bash Java theme={null}
  openapi-generator-cli generate \
    -i https://raw.githubusercontent.com/honeyhiveai/honeyhive-openapi/main/data_plane_openapi.yaml \
    -g java \
    -o ./honeyhive-java-sdk \
    --additional-properties=library=okhttp-gson
  ```

  ```bash Ruby theme={null}
  openapi-generator-cli generate \
    -i https://raw.githubusercontent.com/honeyhiveai/honeyhive-openapi/main/data_plane_openapi.yaml \
    -g ruby \
    -o ./honeyhive-ruby-sdk
  ```

  ```bash C# theme={null}
  openapi-generator-cli generate \
    -i https://raw.githubusercontent.com/honeyhiveai/honeyhive-openapi/main/data_plane_openapi.yaml \
    -g csharp \
    -o ./honeyhive-csharp-sdk
  ```

  ```bash Rust theme={null}
  openapi-generator-cli generate \
    -i https://raw.githubusercontent.com/honeyhiveai/honeyhive-openapi/main/data_plane_openapi.yaml \
    -g rust \
    -o ./honeyhive-rust-sdk
  ```

  ```bash PHP theme={null}
  openapi-generator-cli generate \
    -i https://raw.githubusercontent.com/honeyhiveai/honeyhive-openapi/main/data_plane_openapi.yaml \
    -g php \
    -o ./honeyhive-php-sdk
  ```
</CodeGroup>

The generated client will include typed models, API methods, and authentication handling based on the spec. You can then vendor the generated code directly into your project or publish it as an internal package.

## When to Use What

| Approach                     | Best For                                                                                                                          |
| ---------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| **Generated OpenAPI client** | Teams using languages beyond Python, strict dependency policies, serverless environments, or wanting full control over the client |
| **HoneyHive Tracer SDK**     | Python teams wanting automatic instrumentation with OpenTelemetry, auto-captured LLM calls, and built-in context propagation      |
| **TypeScript API Client**    | TypeScript / Node.js teams wanting a typed REST client for tracing, datasets, and experiments                                     |
| **Direct REST API calls**    | Quick prototyping, one-off scripts, or when you already have an HTTP client configured                                            |

## Next Steps

These guides cover the endpoint workflows for tracing and evaluation:

<CardGroup cols={2}>
  <Card title="Tracing via API" icon="signal-stream" href="/v2/tracing/manual-instrumentation">
    Log sessions and events via REST
  </Card>

  <Card title="Experiments via API" icon="flask" href="/v2/evaluation/via-api">
    Run evaluation experiments via REST
  </Card>

  <Card title="Data Plane API Reference" icon="book" href="/v2/api-reference-autogen/sessions/start-a-new-session">
    Full endpoint reference for events, sessions, datasets, experiments, prompts, and metrics
  </Card>

  <Card title="Control Plane API Reference" icon="book" href="/v2/control-plane-api-reference-autogen/alerts/list-alerts">
    Full endpoint reference for projects and alerts
  </Card>
</CardGroup>

## First-Party SDKs

HoneyHive maintains first-party Python and TypeScript SDKs.

<CardGroup cols={2}>
  <Card title="Python SDK" icon="python" href="https://github.com/honeyhiveai/python-sdk">
    First-party Python SDK with OpenTelemetry tracing and auto-instrumentation.
  </Card>

  <Card title="TypeScript API SDK" icon="js" href="/v2/sdk-reference/typescript">
    Type-safe TypeScript client for the HoneyHive REST API.
  </Card>
</CardGroup>


## Related topics

- [SDK Overview](/v2/sdk-reference/overview.md)
- [AI Experiments and Evaluations in HoneyHive](/v2/evaluation/introduction.md)
- [Clients](/v2/changelog/clients.md)
