Skip to content

Allocate the OpenAI bill to the tenant who spent it.

Chargeback language: the shared OpenAI key is one line on the vendor bill. Headers allocate that line to the tenant, feature, and env that spent it. Not a virtual key.

The OpenAI bill is one line. Finance then asks who spent it. That question is allocation. Chargeback is the same question with an invoice attached. CostSlice allocates the shared key to the tenant, feature, and env on the request. You decide whether to bill it back.

OpenAI cannot do this. The Costs API groups by project, API key, and a user label. Those are their objects. Your tenant_id lives in your product. The usage dashboard is one bill. It is not a chargeback file.

Teams try one key per customer. That is allocation by credential. It does not scale. Keys get copied. Projects pile up. The bill is still one number when someone forgets which key belongs to whom. Keep one OpenAI API key. Put the tenant on the header.

CostSlice does not issue a virtual key. Authorization is your OpenAI API key, forwarded. x-cs-key identifies the workspace. x-cs-tenant is the row. x-cs-feature is the SKU. x-cs-env is prod or staging. Four strings. The allocation is those strings plus tokens and cost.

api.costslice.com/v1

from openai import OpenAI
import os

client = OpenAI(
    base_url="https://api.costslice.com/v1",
    api_key=os.environ["OPENAI_API_KEY"],
    default_headers={
        "x-cs-key": os.environ["COSTSLICE_KEY"],
        "x-cs-tenant": tenant_id,       # opaque id, never an email
        "x-cs-feature": "support-copilot",
        "x-cs-env": "prod",
    },
)

Tenant must be opaque. Never an email. Never a name. Never a medical record number. If the tag is a person, you put personal data in a meter that was built for ids. See OpenAI cost per tenant for the tag itself.

Forgotten tags do not drop the call. The completion still returns. We record untagged. That pile is your reminder to fix the header. Fail the tag, not the customer reply.

We do not cap a tenant because the allocated cost is high. Allocation is a report. A red row is not a block. Starter can stop new proxy calls when the CostSlice plan hits 10,000 requests. That is our plan cap, not a tenant kill switch. Pro and Scale meter overage. They do not shut acme-health off.

Feature allocation matters when one SKU spends the account. A copilot that retries can own the row. Env allocation matters when staging looks like prod. Put both headers on. Then the sheet matches how you already talk about the product.

The finance noun after allocation is the P&L. Cost next to plan price. OpenAI cost P&L is that page. Allocation tells you who spent. The P&L tells you whether they cover it.

Claude is not here. OpenAI only. If you need allocation across providers, that is a different product. We do not pretend to be that product.

Keys stay in your environment. We never store the OpenAI API key. We store a hash of the CostSlice key. We do not email the secret again. Close account revokes CostSlice keys and erases usage metadata. Prompts were never stored.

Starter $0 / Pro $79 / Scale $199, overage $6/100k. No credit card on Starter. Pricing on the homepage wins if a number here is stale.

Starter is free. No credit card. Operated by Operator Media Yard LLC, New Jersey. hello@costslice.com

Questions

Can OpenAI allocate to my tenants?
No. OpenAI can group by project, API key, and a user label. Your tenant id is not an OpenAI object.
Is this chargeback?
It is allocation. You see who spent the shared key. You decide whether to bill it back, raise a price, or leave it.
Forgotten tags drop the call?
No. The completion still returns. We record untagged so you can fix the header.
Virtual key?
No. Keep your OpenAI API key. x-cs-key is a CostSlice credential. We do not replace Authorization with a virtual key.
Claude?
Not today. CostSlice only sits in front of OpenAI. Claude and other models come later.