Vantage API
This page documents the 6 gateway endpoints tagged vantage in the gateway's OpenAPI document. Every example targets a gateway on http://localhost:4000 and authenticates with the SPANWAY_API_KEY environment variable, which holds the master key or a virtual key that has access to the route. Request and response fields are taken from the schema the running gateway publishes at /openapi.json, and the same document is bundled with this site as openapi.json.
| Method | Path | Summary |
|---|---|---|
| DELETE | /vantage/delete | Disconnect Vantage |
| POST | /vantage/dry-run | Preview the rows a Vantage export would send |
| POST | /vantage/export | Send spend to Vantage now |
| POST | /vantage/init | Connect a Vantage account |
| GET | /vantage/settings | Show the Vantage export settings |
| PUT | /vantage/settings | Change the Vantage export settings |
Endpoints
DELETE /vantage/delete
Disconnect Vantage
Remove the saved Vantage connection. Data already sent to Vantage stays there. Proxy admins only, and a 404 means nothing was set up. Docs (https://docs.spanway.ai/docs/proxy/cost_exports)
Example request:
curl -X DELETE "http://localhost:4000/vantage/delete" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | Successful Response | application/json VantageInitResponse |
| 403 | Forbidden | application/json ErrorDetail |
| 404 | Not Found | application/json ErrorDetail |
| 500 | Internal Server Error | application/json ErrorDetail |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
message | string | Yes | Message |
status | string | Yes | Status |
POST /vantage/dry-run
Preview the rows a Vantage export would send
Build the export from the daily spend rollups and return up to limit rows (500 by default) in the FOCUS format with a summary, without sending anything. Proxy admins only. Docs (https://docs.spanway.ai/docs/proxy/cost_exports)
Request body (application/json, schema VantageDryRunRequest):
| Field | Type | Required | Description |
|---|---|---|---|
limit | integer or null | No | Limit on number of records to preview (default: 500) |
Example request:
curl -X POST "http://localhost:4000/vantage/dry-run" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"limit": 20
}'
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | Successful Response | application/json VantageExportResponse |
| 403 | Forbidden | application/json ErrorDetail |
| 422 | Validation Error | application/json HTTPValidationError |
| 500 | Internal Server Error | application/json ErrorDetail |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
dry_run_data | object or null | No | Dry run data including usage data and FOCUS transformed data |
message | string | Yes | Message |
status | string | Yes | Status |
summary | object or null | No | Summary statistics for dry run |
POST /vantage/export
Send spend to Vantage now
Export the daily spend rollups to Vantage at once as a FOCUS file. start_time_utc, end_time_utc and limit narrow what is sent, and without them every row goes. Proxy admins only, and a 404 means Vantage is not set up. Docs (https://docs.spanway.ai/docs/proxy/cost_exports)
Request body (application/json, schema VantageExportRequest):
| Field | Type | Required | Description |
|---|---|---|---|
end_time_utc | string or null | No | End time for data export in UTC |
limit | integer or null | No | Optional limit on number of records to export (default: no limit) |
start_time_utc | string or null | No | Start time for data export in UTC |
Example request:
curl -X POST "http://localhost:4000/vantage/export" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"end_time_utc": "2026-10-08T00:00:00Z",
"start_time_utc": "2026-10-01T00:00:00Z"
}'
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | Successful Response | application/json VantageExportResponse |
| 403 | Forbidden | application/json ErrorDetail |
| 404 | Not Found | application/json ErrorDetail |
| 422 | Validation Error | application/json HTTPValidationError |
| 500 | Internal Server Error | application/json ErrorDetail |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
dry_run_data | object or null | No | Dry run data including usage data and FOCUS transformed data |
message | string | Yes | Message |
status | string | Yes | Status |
summary | object or null | No | Summary statistics for dry run |
POST /vantage/init
Connect a Vantage account
Save the Vantage API key and integration token so spend can be exported to Vantage in the FOCUS format. Both are encrypted before they are stored, and an empty value is a 422. Proxy admins only. Docs (https://docs.spanway.ai/docs/proxy/cost_exports)
Request body (application/json, schema VantageInitRequest):
| Field | Type | Required | Description |
|---|---|---|---|
api_key | string | Yes | Vantage API key for authentication |
base_url | string | No | Vantage API base URL (default: https://api.vantage.sh) |
integration_token | string | Yes | Vantage integration token for the cost-import endpoint |
Example request:
curl -X POST "http://localhost:4000/vantage/init" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"api_key": "vntg_...",
"integration_token": "accss_crdntl_..."
}'
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | Successful Response | application/json VantageInitResponse |
| 403 | Forbidden | application/json ErrorDetail |
| 422 | Validation Error | application/json HTTPValidationError |
| 500 | Internal Server Error | application/json ErrorDetail |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
message | string | Yes | Message |
status | string | Yes | Status |
GET /vantage/settings
Show the Vantage export settings
Return the saved Vantage connection with the API key and integration token masked to their first and last four characters. Proxy admins and admin viewers only, empty fields and a null status mean nothing is set up yet. Docs (https://docs.spanway.ai/docs/proxy/cost_exports)
Example request:
curl -X GET "http://localhost:4000/vantage/settings" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | Successful Response | application/json VantageSettingsView |
| 403 | Forbidden | application/json ErrorDetail |
| 500 | Internal Server Error | application/json ErrorDetail |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
api_key_masked | string or null | No | Masked API key showing only first 4 and last 4 characters |
base_url | string or null | No | Vantage API base URL |
integration_token_masked | string or null | No | Masked integration token showing only first 4 and last 4 characters |
status | string or null | No | Configuration status |
PUT /vantage/settings
Change the Vantage export settings
Change only the fields you send, api_key, integration_token or base_url, and keep the others. Secrets are encrypted before they are stored. Proxy admins only, and a 404 means there is nothing to change yet. Docs (https://docs.spanway.ai/docs/proxy/cost_exports)
Request body (application/json, schema VantageSettingsUpdate):
| Field | Type | Required | Description |
|---|---|---|---|
api_key | string or null | No | New Vantage API key for authentication |
base_url | string or null | No | New Vantage API base URL |
integration_token | string or null | No | New Vantage integration token |
Example request:
curl -X PUT "http://localhost:4000/vantage/settings" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"integration_token": "accss_crdntl_..."
}'
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | Successful Response | application/json VantageInitResponse |
| 400 | Bad Request | application/json ErrorDetail |
| 403 | Forbidden | application/json ErrorDetail |
| 404 | Not Found | application/json ErrorDetail |
| 422 | Validation Error | application/json HTTPValidationError |
| 500 | Internal Server Error | application/json ErrorDetail |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
message | string | Yes | Message |
status | string | Yes | Status |