Prerequisites
Before you begin, verify that you have the following:- A CoreWeave account with Inference access enabled.
- A CoreWeave API access token with the Inference Admin role.
- Model weights uploaded to a CoreWeave Object Storage bucket. Dedicated Inference uses a bring-your-own-weights (BYOW) model. Download model weights from your model provider and upload them to Object Storage before starting.
- The CoreWeave Intelligent CLI (
cwic), which this guide uses for its primary examples. The guide also shows the equivalentcurlrequests and a CoreWeave Terraform provider configuration, so you can usecurlor Terraform instead. curl, which the final inference request uses even if you create resources with the CLI or Terraform.- Terraform or OpenTofu, only if you use the Terraform path. Running
terraform initinstalls the CoreWeave Terraform provider from the registry.
Want to interact with the API programmatically? See the Inference API reference for the REST, gRPC, and Connect interfaces, or install a generated client from the Inference SDKs.
Set your API token
Set your API token as an environment variable so that subsequent commands can authenticate with the CoreWeave API. Replace[API-TOKEN] with your token. For details about creating a token, see Manage API access tokens.
- CoreWeave Intelligent CLI
- curl
Authenticate To open Verify you’re authenticated:
cwic once. It stores the token in ~/.cwic/config.json and reuses it for every subsequent cwic inference command.console.coreweave.com/tokens in your browser and paste a different token interactively, run the command without an argument:Grant inference access to your bucket
Dedicated Inference reads model weights from CoreWeave Object Storage using a dedicated service account. Attach the following bucket policy to your weights bucket so the service can list and read its contents. Replace[BUCKET-NAME] with the name of the bucket containing your model weights.
inference-bucket-policy.json) and apply it with the AWS CLI. If you have configured a named AWS CLI profile for CoreWeave (for example, cw), pass it with --profile [PROFILE-NAME]. Omit --profile if your CoreWeave credentials are in the default profile.
This bucket policy for inference has the potential to override your existing permissions and bucket policy. This put-bucket-policy command is a
replace, not a merge.The
Principal value is the canonical CoreWeave Inference service account and is the same for all customers. A missing bucket policy is the most common cause of deployments that fail to load weights. For tooling alternatives (s3cmd, Boto3, Terraform), how to scope access to a specific path prefix, and notes on the Cloud Console, see Grant inference access to your bucket.Create a gateway
With the bucket policy in place, provision the gateway. A gateway provides the external endpoint that routes traffic to your model deployments. It handles authentication and load balancing.Prefer to manage both resources as code? Skip ahead to Deploy with Terraform. You still run the
parameters queries in this section and Create a deployment to choose valid zone, instance type, and engine version values.- CoreWeave Intelligent CLI
- curl
If this first request fails, check the
message field. Both of the following errors return gRPC code 7 (HTTP 403):"organization is not allowed to perform this operation": your organization isn’t enabled for Dedicated Inference yet. Contact your CoreWeave representative or CoreWeave support with your organization ID to request access."insufficient permissions for this operation": your API access token is missing the Inference Admin role. Add the role to the token’s identity, then retry.
[ZONE-NAME] with a zone from the response.
The gateway name must be a valid hostname label containing no more than 38 letters, digits, or hyphens. It must begin and end with a letter or digit, and it cannot contain dots. The 38-character limit accommodates DNS and TLS certificate constraints. If the hostname-label validation fails, you receive validation error: name: must be a valid hostname label.
This example creates a gateway with CoreWeave IAM authentication and body-based routing, which routes requests based on the model field in the request body. Body-based routing is the default and follows OpenAI API conventions.
- CoreWeave Intelligent CLI
- curl
ID, NAME, ZONES, AUTH, ROUTING, STATUS, and ENDPOINTS columns. Save the value from the ID column for the next step. You need this ID to associate deployments with the gateway. Add -o json to get the same fields as machine-readable JSON.If the create request returns
{"code":8, "message":"gateway quota exceeded: maximum is 0"} (HTTP 429), your organization has no inference gateway quota. Contact your CoreWeave representative or CoreWeave support to request inference quota for your organization.The gateway may take a few moments to become ready. You can check its status with a
GET request to /v1alpha1/inference/gateways/{id}, or with cwic inference gateway get [GATEWAY-ID].View all gateways
You can view all existing gateways with the following command. Use it to confirm your gateway was created correctly.- CoreWeave Intelligent CLI
- curl
Create a deployment
A deployment configures a model serving instance with your chosen runtime, GPU type, and model weights. Attaching the deployment to the gateway you just created makes the model reachable through the gateway endpoint. First, query the available instance types and runtime versions so you can pick a GPU type and runtime that match your model:- CoreWeave Intelligent CLI
- curl
gatewayIds. It also groups the available options into two objects: resourceParameters.instanceTypes lists the GPU instance types you can deploy on, and runtimeParameters.runtimeVersions lists the available versions for each engine (such as vllm). Use these to choose a valid [GATEWAY-ID], [INSTANCE-TYPE], and [ENGINE-VERSION] below. If resourceParameters or instanceTypes is empty, no instance type is currently available for the request. Confirm that your organization has an eligible gateway and inference quota. When you filter by gateway IDs, also confirm that the selected gateways share an available instance type.
Then create a deployment that references your gateway. Replace the placeholder values:
[GATEWAY-ID]: The gateway ID from the previous step (creating the gateway, or theinference/gatewayslist command).[INSTANCE-TYPE]: An instance type from theinference/deployments/parametersresponse in the previous step. For details on each type, see GPU instances.[MODEL-NAME]: A name for your model (from 4 to 63 characters). The gateway uses this name to route inference requests to this deployment.[BUCKET-NAME]: The CoreWeave Object Storage bucket containing the model weights.[MODEL-PATH]: The path within the bucket to the model directory.[ENGINE-VERSION]: Thevllmruntime version to serve your model with. Theinference/deployments/parametersresponse (above) returns the available versions.
- Deployment
name: Identifies the deployment in the management API. It must be a valid hostname label containing no more than 63 letters, digits, or hyphens. It must begin and end with a letter or digit, and it cannot contain dots. - Model
name: Identifies the model in inference requests. It must be 4 to 63 characters long and can include letters, digits, periods, underscores, colons, slashes, and hyphens.
name fails validation, you receive validation error: name: must be a valid hostname label.
An S3 path breaks down into
[BUCKET-NAME] and [MODEL-PATH]. For example, s3://test-bucket/raw/Qwen/Qwen3.5-0.8B/2fc06364715b967f1860aea9cf38778875588b17 breaks down into:{"code":3, "message":"model path has no objects: path ..."}, the model path is invalid or inaccessible.
If you receive {"code":3, "message":"model bucket is not accessible..."}, the bucket is invalid or inaccessible.
- CoreWeave Intelligent CLI
- curl
--traffic-weight flag has no effect for a single deployment: it controls traffic splitting only when two or more deployments share the same model name on a gateway. Leave the value at 100 for this guide. For details, see Traffic weights.The output is a table that includes the new deployment’s ID and STATUS columns. Save the value from the ID column so subsequent commands can reference the deployment. Add -o json to get the same fields as machine-readable JSON.View all deployments
You can view all existing deployments with the following command. Use it to confirm your deployment was created correctly.- CoreWeave Intelligent CLI
- curl
Deploy with Terraform
The previous two sections created a gateway and a deployment by calling the API directly. If you manage infrastructure as code, you can define both resources in a single Terraform configuration and apply them together instead.If you already created your gateway and deployment with the CLI or
curl, skip this section and continue at Wait for the deployment to start. If you are starting here, first run the gateway and deployment parameters queries from Create a gateway and Create a deployment to choose valid zone, instance type, and engine version values.[ZONE-NAME], [ENGINE-VERSION], [INSTANCE-TYPE], [MODEL-NAME], [BUCKET-NAME], and [MODEL-PATH], using the same guidance as the API examples above.
The configuration declares each value as a required variable. When you run terraform apply, Terraform prompts you to enter the corresponding value without the brackets.
main.tf
gateway_ids field references the gateway resource’s id attribute, Terraform creates the gateway first and the deployment second, even though both are defined in the same configuration.
coreweave_inference_gateway and coreweave_inference_deployment resource references.
Wait for the deployment to start
After creation, the deployment loads model weights and starts the inference engine. Poll the deployment status until it reachesSTATUS_READY. This typically takes several minutes.
- CoreWeave Intelligent CLI
- curl
STATUS column until it shows READY.- CoreWeave Intelligent CLI
- curl
ENDPOINTS column.gateway.status.endpoints field contains an array of endpoint URLs for inference requests. The first entry is the primary endpoint:
The gateway’s public DNS record and TLS certificate provision asynchronously while the gateway is created. Wait until the gateway reaches
STATUS_READY and exposes an endpoint. If your first inference request fails with an SSL handshake error or DNS resolution failure, wait a few minutes and retry.Send an inference request
With the deployment ready and the gateway endpoint exported, you can now send your first inference request to verify the end-to-end path. The gateway exposes an OpenAI-compatible API. With body-based routing, the gateway routes requests based on themodel field in the request body. Send a chat completion request using the model name from your deployment:
coreWeaveAuth.
The response is an OpenAI-compatible chat completion. Beyond the standard fields, vLLM also returns several engine-specific fields (token_ids, prompt_logprobs, kv_transfer_params, and others). These are typically null for normal requests, so you can ignore them.
openai library:
Update a deployment
Over time, you may need to adjust capacity, swap the GPU type, or point the deployment at new model weights. To change a deployment’s configuration, send aPATCH request with the complete deployment specification. All fields are required, not just the ones you change. Omitting a field either fails validation (for required fields) or reverts it to its default, so start from the command you used to create the deployment and change only the fields you want to update.
This example increases the autoscaling maximum from 1 to 4:
Changing
model.name changes the route key that clients send to the gateway. Update clients to use the new model name after the deployment update completes.- CoreWeave Intelligent CLI
- curl
Like the REST
PATCH request, cwic inference deployment update sends the complete deployment specification. Omitted flags revert to their default, so re-specify every flag from the create command and change only the ones you want to update:If you created the deployment with Terraform, change the
coreweave_inference_deployment resource block and run terraform apply instead of calling the API directly.Observability
To view logs from your deployment:- Go to console.coreweave.com and open Grafana under the Observability section.
- In Grafana, click Explore in the left nav, then select CoreWeave Logs from the data source dropdown.
- In the query builder, click Code on the right, then enter the following query:
- Click Run query in the top-right corner to see the logs.
Clean up
When you no longer need the inference endpoint, delete the resources to stop incurring charges. You must delete deployments before their associated gateway.- CoreWeave Intelligent CLI
- curl
If you created these resources with Terraform, run
terraform destroy instead.Next steps
You now have a working baseline: a gateway, a deployment serving a model, and a successful inference response. Explore these resources to learn more about CoreWeave Inference and to take the deployment beyond a single-replica baseline.- Gateways: Configure authentication, routing strategies, and traffic splitting.
- Models and deployments: Learn about runtime configuration, GPU selection, and deployment options.
- Scaling: Configure autoscaling and reserve GPU capacity.
- Billing: Understand pricing and optimize inference costs.
- Inference API reference: Explore the full API surface.
- CoreWeave Provider: Explore the full Terraform resource and data source schema for Inference.