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

# Ingestion API

> Send events and provider log drain payloads into Squasher.

Use the ingestion endpoints when you are building a custom integration or forwarding logs from a provider.

## OTLP ingestion

* `POST https://ingest.squasher.ai/v1/traces`
* `POST https://ingest.squasher.ai/v1/logs`
* `POST https://ingest.squasher.ai/v1/metrics`

These endpoints accept OTLP/HTTP protobuf or JSON payloads with the same `x-squasher-key` authentication header.

Successful OTLP responses confirm durable acceptance. During a telemetry-store interruption, accepted batches can enter regional recovery storage and appear after live data. Delivery is at least once, so stable OpenTelemetry event identities remain important. Retry `429` and `5xx` responses with bounded exponential backoff.

## Error ingestion

```text theme={null}
POST https://ingest.squasher.ai/v1/ingest/{project_id}
```

### Required headers

* `x-squasher-key`
* `Content-Type: application/json` or `application/x-ndjson`

### Accepted body shapes

With `application/json`, send any of these shapes:

* One event object
* A top-level array of event objects
* An envelope shaped as `{ "events": [...] }`

With `application/x-ndjson`, send one event object per non-empty line. Empty, malformed, and non-object event payloads return `400` and are not forwarded.

### Typical fields

* `message`
* `type`
* `stack` or parsed `frames`
* `level`
* `environment`
* `release`
* `tags`, `user`, `request`, `breadcrumbs`, and `extra`

## Provider drains

* `POST /v1/drain/vercel/{project_id}`
* `POST /v1/drain/railway/{project_id}`
* Cloud provider drains documented under `/log-drains/*`

## AI workflow ingest

For agent sessions, model generations, and tool calls, prefer the [Agent telemetry SDK](/sdks/agent). Custom senders can post Langfuse-compatible AI batches to:

```text theme={null}
POST https://ingest.squasher.ai/v1/ai/ingest/{project_id}
```

Use the same `x-squasher-key` header. See the [OpenRouter direct HTTP example](/integrations/openrouter#direct-http-ingest-no-sdk) for a worked batch payload.

## Agent handoff

Use ingestion endpoints only when an SDK, OpenTelemetry exporter, or managed connector is not the better fit:

```text theme={null}
Build a Squasher ingestion path for project <project_id>. Prefer an official SDK or OpenTelemetry first. If direct HTTP is required, send JSON or NDJSON in a supported shape to /v1/ingest/{project_id}, include x-squasher-key from environment variables, and verify with one safe test event.
```

Agents should never hardcode real keys. For reusable log sources, create a managed connector through the [Log Connectors API](/api-reference/log-connectors), CLI, or MCP Code Mode instead of sharing the project key.

## Related guides

* [Vercel log drain](/integrations/vercel)
* [Railway log drain](/integrations/railway)
* [AWS CloudWatch Logs](/log-drains/aws-cloudwatch)
