How do I track OpenAI Batch API costs by feature?
Create and manage OpenAI batches through Cognocient AI (/v1/files and /v1/batches) and have each batch's discounted cost attributed to your tags the moment it finishes. Growth plan and above.
The Batch API runs large jobs asynchronously at half the price, with results within 24 hours. Cognocient AI sits in front of it so batch spend shows up next to everything else instead of appearing as an unexplained line on your OpenAI invoice.
Attribution
Send your X-Cost-Feature, X-Cost-Department, X-Cost-Project and other headers when creating the batch. They are stored with the job and used when its cost is recorded, so a batch created by one team is billed to that team even if someone else collects the results.
The model is read from the first request line of your input file. If a file mixes several models, the whole batch is priced at the first line's model and the cost is an approximation.
What is supported
| Endpoint | Notes |
|---|---|
POST /v1/files | Only purpose=batch |
GET /v1/files/{id}, /content, DELETE | Passed through |
POST /v1/batches, GET /v1/batches, GET /v1/batches/{id}, POST /v1/batches/{id}/cancel | Passed through; finished batches are costed |
Failed, expired and cancelled batches are closed out at $0 if OpenAI reports no usage for them.
Limits
- OpenAI only, with your own OpenAI key.
- Batch creation is not budget-reserved: cost is added when the batch completes.
- Fine-tuning and assistant files are not accepted through this endpoint.
Related articles
OpenAI Responses API
POST /v1/responses on every provider, with streaming and function tools. Budgets, guardrails and routing apply unchanged.
Audio & Rerank Endpoints
Transcription, translation, speech and rerank through Cognocient AI, with the same budgets, guardrails and cost tracking as chat.
MCP Gateway
Govern MCP servers: tool allow/deny policy, argument scanning, per-call pricing and full attribution. Business plan.