# Image generation (Passthrough. Diffusion and custom APIs)

These frequently expose **custom request/response formats**, so they are typically accessed via **passthrough endpoints**, not the OpenAI Images API.

Passthrough means. AlphaNeural forwards your request to the upstream provider or service **without normalising the payload**.

### When to use passthrough

Use passthrough when:

* the model is **diffusion-based** (or otherwise not OpenAI Images compatible),
* the upstream requires a **custom endpoint path** or **custom JSON schema**,
* you want to use the provider’s native features that do not map cleanly to OpenAI parameters.

### Endpoint shape

AlphaNeural exposes provider passthrough routes in the form:

* `/{provider}/{endpoint}`

For example, the spec includes a pass-through route for OpenAI itself:

* `POST https://proxy.alfnrl.io/openai/{endpoint}`

{% hint style="warning" %}
Passthrough routes are **not OpenAI-compatible by definition**. Your payload and response format are whatever the upstream expects.
{% endhint %}

### Example. Passing through to an upstream Images endpoint

If you need to call a openai deployment directly (or reproduce an upstream call exactly), you can passthrough the endpoint path:

```bash
curl https://proxy.alfnrl.io/openai/v1/images/generations \
  -H "Authorization: Bearer $ALPHANEURAL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-image-1",
    "prompt": "An isometric diagram of a neural network as a subway map"
  }'
```

### Example. Diffusion deployment via passthrough (template)

For Stable Diffusion-style deployments, you will call the **deployment’s native path** and send its **native payload**:

```bash
curl https://proxy.alfnrl.io/<provider>/<native-endpoint-path> \
  -H "Authorization: Bearer $ALPHANEURAL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '<native-json-payload>'
```

AlphaNeural will document each diffusion deployment with:

* the `{provider}` prefix,
* the exact `<native-endpoint-path>`,
* the required auth headers (if any) beyond the AlphaNeural key.

{% hint style="info" %}
If you want a diffusion model to be callable via `POST /v1/images/generations`, it must be deployed behind an OpenAI-compatible adapter. Otherwise, passthrough is the correct interface.
{% endhint %}
