SQL over your logs and billing
curl --request POST \
--url https://api.cycls.ai/v1/sql \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data @- <<EOF
{
"query": "SELECT timestamp, json_payload FROM logs WHERE json_payload.level='error' LIMIT 10"
}
EOFimport requests
url = "https://api.cycls.ai/v1/sql"
payload = { "query": "SELECT timestamp, json_payload FROM logs WHERE json_payload.level='error' LIMIT 10" }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
query: 'SELECT timestamp, json_payload FROM logs WHERE json_payload.level=\'error\' LIMIT 10'
})
};
fetch('https://api.cycls.ai/v1/sql', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Logs
SQL over your logs and billing
Run SQL against your own logs and billing data. Two views are pre-set in your default dataset:
logs, Cloud Logging entries for your deploymentsbilling, Cloud Billing rows for your deployments
Each tenant gets their own BigQuery dataset and service account; cross-tenant references fail at the IAM layer.
POST
https://api.cycls.ai
/
v1
/
sql
SQL over your logs and billing
curl --request POST \
--url https://api.cycls.ai/v1/sql \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data @- <<EOF
{
"query": "SELECT timestamp, json_payload FROM logs WHERE json_payload.level='error' LIMIT 10"
}
EOFimport requests
url = "https://api.cycls.ai/v1/sql"
payload = { "query": "SELECT timestamp, json_payload FROM logs WHERE json_payload.level='error' LIMIT 10" }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
query: 'SELECT timestamp, json_payload FROM logs WHERE json_payload.level=\'error\' LIMIT 10'
})
};
fetch('https://api.cycls.ai/v1/sql', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
APIKeyHeaderHTTPBearer
Your Cycls API key, from https://cloud.cycls.com. Sent as the X-API-Key header. This is the CYCLS_API_KEY the CLI uses.
Body
application/json
BigQuery SQL. Your default dataset contains views logs and billing scoped to deployments you own.
Example:
"SELECT timestamp, json_payload FROM logs WHERE json_payload.level='error' LIMIT 10"
Response
Successful Response