# CoreWeave Serverless Inference

[CoreWeave Serverless Inference](https://docs.coreweave.com/products/inference/serverless) provides hosted access to open-source foundation models through an OpenAI-compatible API. AISIX maps those models to stable aliases and controls caller access at the gateway.

## Prerequisites[​](#prerequisites "Direct link to Prerequisites")

Before starting, prepare the following:

* One AISIX setup:

  <!-- -->

  * For AISIX Enterprise or AISIX Cloud, an environment with an attached gateway and a write-scoped admin token. For AISIX Enterprise, follow the [AISIX Enterprise getting-started guide](https://docs.api7.ai/ai-gateway/getting-started/aisix-cloud-quickstart.md). To request AISIX Cloud access, [contact API7](https://api7.ai/contact).
  * For the open-source AISIX gateway, prepare either a local AISIX installation or the Docker setup from the [AISIX OSS getting-started guide](https://docs.api7.ai/ai-gateway/getting-started/gateway-quickstart.md). Configure the gateway to load a declarative resources file.

* A [CoreWeave Forge account](https://forge.coreweave.com/) with [Serverless Inference credits](https://docs.coreweave.com/products/inference/serverless/usage-limits) and a [Forge API key](https://forge.coreweave.com/settings).

* Access to a model in the [Serverless Inference catalog](https://docs.coreweave.com/products/inference/serverless/models).

* `curl` and `jq`.

## Configure with AISIX Enterprise or AISIX Cloud[​](#configure-with-aisix-enterprise-or-aisix-cloud "Direct link to Configure with AISIX Enterprise or AISIX Cloud")

Export the control-plane connection details:

```
# AISIX_CP is the Admin API base URL; include /api and omit a trailing slash

# The local AISIX Enterprise quickstart uses http://localhost:8080/api

export AISIX_CP="YOUR_AISIX_CONTROL_PLANE_API_URL"

export AISIX_TOKEN="YOUR_ADMIN_TOKEN"

export ENV_ID="YOUR_ENVIRONMENT_ID"
```

CoreWeave Serverless Inference is a community catalog provider with an OpenAI-compatible API. AISIX connects through the `openai` adapter and authenticates upstream requests with a bearer token.

### Create a Provider Key[​](#create-a-provider-key "Direct link to Create a Provider Key")

Create a provider key that stores the Forge API key and uses the legacy `wandb` provider ID:

```
export COREWEAVE_API_KEY="YOUR_FORGE_API_KEY"



PROVIDER_KEY_ID=$(

  curl -sS -X POST "$AISIX_CP/provider_keys" \

    -H "Authorization: Bearer $AISIX_TOKEN" \

    -H "Content-Type: application/json" \

    -d '{

      "display_name": "coreweave-prod",

      "provider": "wandb",

      "api_key": "'"${COREWEAVE_API_KEY}"'",

      "api_base": "https://api.inference.wandb.ai/v1",

      "allowed_environments": ["'"${ENV_ID}"'"]

    }' | jq -er '.provider_key.id'

)



echo "$PROVIDER_KEY_ID"
```

The AISIX catalog keeps the legacy provider ID `wandb` for CoreWeave Serverless Inference. Do not add `adapter`; AISIX derives the `openai` adapter for catalog providers. CoreWeave also continues to serve this API from the legacy W\&B hostname, `api.inference.wandb.ai`.

The explicit API base includes `/v1`. AISIX appends `/chat/completions` when it sends the upstream request.

Usage attribution still uses W\&B entity and project identifiers. When no project is specified, the service uses your default entity and the `inference` project. To attribute usage elsewhere, set `OpenAI-Project` to `{entity}/{project}` in `request.default_headers` on the provider key. See [Upstream Request Headers](https://docs.api7.ai/ai-gateway/models/upstream-request-headers.md#request-context-header-values).

### Create a Model[​](#create-a-model "Direct link to Create a Model")

Create an alias with the complete Serverless Inference model ID:

```
MODEL_ID=$(

  curl -sS -X POST "$AISIX_CP/environments/$ENV_ID/models" \

    -H "Authorization: Bearer $AISIX_TOKEN" \

    -H "Content-Type: application/json" \

    -d '{

      "display_name": "coreweave-llama-prod",

      "model_name": "meta-llama/Llama-3.1-8B-Instruct",

      "provider_key_id": "'"${PROVIDER_KEY_ID}"'"

    }' | jq -er '.model.id'

)



echo "$MODEL_ID"
```

Preserve the publisher namespace and casing when substituting another model from the Serverless Inference catalog.

### Create a Caller API Key[​](#create-a-caller-api-key "Direct link to Create a Caller API Key")

Create a caller key that grants access to the model alias:

```
AISIX_API_KEY=$(

  curl -sS -X POST "$AISIX_CP/environments/$ENV_ID/api_keys" \

    -H "Authorization: Bearer $AISIX_TOKEN" \

    -H "Content-Type: application/json" \

    -d '{

      "display_name": "coreweave-inference-caller",

      "allowed_models": ["'"${MODEL_ID}"'"]

    }' | jq -er '.plaintext'

)



echo "$AISIX_API_KEY"
```

## Configure with AISIX OSS[​](#configure-with-aisix-oss "Direct link to Configure with AISIX OSS")

Export the upstream credential and choose the caller API key that applications will send to the gateway:

```
export COREWEAVE_API_KEY="YOUR_FORGE_API_KEY"

export CALLER_API_KEY="YOUR_CALLER_API_KEY"

export CALLER_API_KEY_SHA256="$(printf '%s' "$CALLER_API_KEY" | sha256sum | cut -d ' ' -f 1)"
```

For a new gateway, use this complete resources file. For an existing gateway, merge the entries into its [current file](https://docs.api7.ai/ai-gateway/reference/resources-file.md#apply-resource-examples-safely), preserving its other resources:

resources.yaml

```
_format_version: "2"



provider_keys:

  - id: 95f41c6d-a059-4eb7-9a7b-2fe8fd3e5667

    display_name: "coreweave-prod"

    provider: "wandb"

    adapter: "openai"

    api_key: ${COREWEAVE_API_KEY}

    api_base: "https://api.inference.wandb.ai/v1"



models:

  - id: 24827634-0591-42c1-b5e0-ba066b341ba0

    display_name: "coreweave-llama-prod"

    provider: "wandb"

    model_name: "meta-llama/Llama-3.1-8B-Instruct"

    provider_key_id: 95f41c6d-a059-4eb7-9a7b-2fe8fd3e5667



api_keys:

  - id: c55d6825-c752-4b96-b865-629d09c1c3f3

    display_name: "coreweave-inference-caller"

    key_hash: ${CALLER_API_KEY_SHA256}

    allowed_models:

      - "coreweave-llama-prod"
```

If AISIX is installed locally, validate the file before loading it:

```
aisix validate --resources resources.yaml
```

After validation, start the gateway with the referenced environment variables in its process environment. Reload an existing gateway only if those variables are already available to the process; otherwise, restart it with the updated environment.

If you use Docker, adapt the validation and startup commands in the [AISIX OSS getting-started guide](https://docs.api7.ai/ai-gateway/getting-started/gateway-quickstart.md). Mount this `resources.yaml` file and pass every environment variable it references with `-e` in both commands. After the resources load, prepare the shared verification request below:

```
export AISIX_API_KEY="$CALLER_API_KEY"
```

## Verify the Provider Connection[​](#verify-the-provider-connection "Direct link to Verify the Provider Connection")

Export the AISIX gateway origin:

```
# AISIX_PROXY has no trailing slash or endpoint path

# The local quickstarts use http://127.0.0.1:3000

export AISIX_PROXY="YOUR_AISIX_GATEWAY_URL"
```

Send a chat-completions request through the AISIX proxy:

```
curl -sS -X POST "$AISIX_PROXY/v1/chat/completions" \

  -H "Authorization: Bearer $AISIX_API_KEY" \

  -H "Content-Type: application/json" \

  -d '{

    "model": "coreweave-llama-prod",

    "messages": [

      {

        "role": "user",

        "content": "Say hello from CoreWeave Serverless Inference."

      }

    ]

  }'
```

AISIX forwards the upstream model ID to `POST /v1/chat/completions` with the Forge API key in the bearer header.

## Endpoint Coverage[​](#endpoint-coverage "Direct link to Endpoint Coverage")

CoreWeave Serverless Inference currently exposes OpenAI-compatible chat completions and model listing. AISIX adds its chat-based protocol bridges, but it cannot add an upstream capability that Serverless Inference does not expose:

| Route                                                    | Behavior with a model using provider `wandb`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| -------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `/v1/chat/completions`                                   | Supported, buffered and streaming.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `/v1/responses`                                          | Supported through the [Responses bridge](https://docs.api7.ai/ai-gateway/endpoints/responses-api.md). Fields without a chat-completions equivalent are ignored.                                                                                                                                                                                                                                                                                                                                                                |
| `/v1/messages`                                           | Supported through AISIX translation to chat completions. `/v1/messages/count_tokens` is not supported because the model is not Anthropic-backed.                                                                                                                                                                                                                                                                                                                                                                               |
| `/v1/embeddings`                                         | Not supported. CoreWeave Serverless Inference does not publish an embeddings endpoint on this API root.                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `/v1/models`                                             | Returns caller-accessible AISIX aliases, not the CoreWeave model catalog. Call `GET /passthrough/wandb/models` to reach CoreWeave's native model-list endpoint with the configured provider credential.                                                                                                                                                                                                                                                                                                                        |
| `/v1/images/generations`, `/v1/videos`, and `/v1/rerank` | Not supported. CoreWeave does not expose these APIs on Serverless Inference, and the `wandb` provider value is outside the normalized routes' allowlists.                                                                                                                                                                                                                                                                                                                                                                      |
| `/passthrough/wandb/*rest`                               | Available through a configured [passthrough route](https://docs.api7.ai/ai-gateway/endpoints/provider-passthrough.md) claiming this prefix with the CoreWeave API root as its `target_url`; grant the route on the caller key's `allowed_routes`. Passthrough does not rewrite AISIX aliases and relays SSE responses incrementally. For the request shapes that record token usage, see [Envelope Detection and Usage](https://docs.api7.ai/ai-gateway/endpoints/provider-passthrough.md#envelope-detection-and-token-usage). |

See [Provider Compatibility](https://docs.api7.ai/ai-gateway/providers/compatibility.md) for the full endpoint and provider matrix.

## Troubleshooting[​](#troubleshooting "Direct link to Troubleshooting")

| Symptom                             | Check                                                                                          |
| ----------------------------------- | ---------------------------------------------------------------------------------------------- |
| Upstream `401` or `403`             | Confirm the Forge API key is valid and belongs to an account with Serverless Inference access. |
| Upstream `404`                      | Keep `/v1` in the API base and verify the model ID.                                            |
| Model not found                     | Preserve the publisher namespace and casing.                                                   |
| Provider key creation returns `400` | Use `provider: "wandb"` without `adapter`.                                                     |

## Next Steps[​](#next-steps "Direct link to Next Steps")

You have now connected AISIX to CoreWeave Serverless Inference and verified the model alias. Continue with these guides:

* [Provider Keys](https://docs.api7.ai/ai-gateway/models/provider-keys.md): manage provider-key rotation and environment access.
* [Model Aliases](https://docs.api7.ai/ai-gateway/models/model-aliases.md): configure routing, retry behavior, or cost metadata for the alias.
* [Routing and Failover](https://docs.api7.ai/ai-gateway/routing/routing-and-failover.md): fail over between CoreWeave Serverless Inference and another provider.
* [Provider Compatibility](https://docs.api7.ai/ai-gateway/providers/compatibility.md): review supported proxy endpoints and provider-specific boundaries.
