Skip to main content

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.

MethodPathSummary
DELETE/vantage/deleteDisconnect Vantage
POST/vantage/dry-runPreview the rows a Vantage export would send
POST/vantage/exportSend spend to Vantage now
POST/vantage/initConnect a Vantage account
GET/vantage/settingsShow the Vantage export settings
PUT/vantage/settingsChange 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:

StatusDescriptionBody
200Successful Responseapplication/json VantageInitResponse
403Forbiddenapplication/json ErrorDetail
404Not Foundapplication/json ErrorDetail
500Internal Server Errorapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
messagestringYesMessage
statusstringYesStatus

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):

FieldTypeRequiredDescription
limitinteger or nullNoLimit 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:

StatusDescriptionBody
200Successful Responseapplication/json VantageExportResponse
403Forbiddenapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500Internal Server Errorapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
dry_run_dataobject or nullNoDry run data including usage data and FOCUS transformed data
messagestringYesMessage
statusstringYesStatus
summaryobject or nullNoSummary 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):

FieldTypeRequiredDescription
end_time_utcstring or nullNoEnd time for data export in UTC
limitinteger or nullNoOptional limit on number of records to export (default: no limit)
start_time_utcstring or nullNoStart 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:

StatusDescriptionBody
200Successful Responseapplication/json VantageExportResponse
403Forbiddenapplication/json ErrorDetail
404Not Foundapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500Internal Server Errorapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
dry_run_dataobject or nullNoDry run data including usage data and FOCUS transformed data
messagestringYesMessage
statusstringYesStatus
summaryobject or nullNoSummary 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):

FieldTypeRequiredDescription
api_keystringYesVantage API key for authentication
base_urlstringNoVantage API base URL (default: https://api.vantage.sh)
integration_tokenstringYesVantage 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:

StatusDescriptionBody
200Successful Responseapplication/json VantageInitResponse
403Forbiddenapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500Internal Server Errorapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
messagestringYesMessage
statusstringYesStatus

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:

StatusDescriptionBody
200Successful Responseapplication/json VantageSettingsView
403Forbiddenapplication/json ErrorDetail
500Internal Server Errorapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
api_key_maskedstring or nullNoMasked API key showing only first 4 and last 4 characters
base_urlstring or nullNoVantage API base URL
integration_token_maskedstring or nullNoMasked integration token showing only first 4 and last 4 characters
statusstring or nullNoConfiguration 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):

FieldTypeRequiredDescription
api_keystring or nullNoNew Vantage API key for authentication
base_urlstring or nullNoNew Vantage API base URL
integration_tokenstring or nullNoNew 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:

StatusDescriptionBody
200Successful Responseapplication/json VantageInitResponse
400Bad Requestapplication/json ErrorDetail
403Forbiddenapplication/json ErrorDetail
404Not Foundapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500Internal Server Errorapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
messagestringYesMessage
statusstringYesStatus