# 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 %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.alphaneural.io/image-generation-passthrough.-diffusion-and-custom-apis.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
