nav.announce

Quickstart

Last updated 2026-10-05

Call a model through Aston AI Gateway with the OpenAI SDK and let it read live sensing data, in about five minutes.

This API is a draft and the final docs prevail. AI Gateway beta is planned for Q1 2027.

1

Log in, open API keys from the account menu and create a key.

2

Install the OpenAI SDK: pip install openai or npm install openai.

3

Point base_url at https://api.aston.ai/v1 and send your first request.

4

List the allowed Sense Tools in the aston field and set a DC cap for the request.

Python

from openai import OpenAI

client = OpenAI(base_url='https://api.aston.ai/v1', api_key='ASTON_API_KEY')

resp = client.chat.completions.create(
    model='deepseek/deepseek-chat',
    messages=[{'role': 'user', 'content': 'Is now a good time to run near Marina Bay, Singapore?'}],
    extra_body={'aston': {
        'sense_tools': ['air_quality', 'noise', 'micro_weather'],
        'max_dc': 200,  # tool budget for this request: 200 DC = $0.02
    }},
)
print(resp.choices[0].message.content)

Node.js

import OpenAI from 'openai';

const client = new OpenAI({ baseURL: 'https://api.aston.ai/v1', apiKey: process.env.ASTON_API_KEY });

const resp = await client.chat.completions.create({
  model: 'deepseek/deepseek-chat',
  messages: [{ role: 'user', content: 'Is now a good time to run near Marina Bay, Singapore?' }],
  aston: { sense_tools: ['air_quality', 'noise'], max_dc: 200 }, // Aston extension field
});
console.log(resp.choices[0].message.content);

cURL

curl https://api.aston.ai/v1/chat/completions \
  -H "Authorization: Bearer $ASTON_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "deepseek/deepseek-chat", "messages": [{"role": "user", "content": "Is now a good time to run near Marina Bay?"}], "aston": {"sense_tools": ["air_quality"], "max_dc": 200}}'

Was this page helpful?