opendunes
Helpers · 2 min
Copy page ▾

Date and time

Give a model the current date and time, in the time zone you choose.

  1. What it does.
  2. Name it in tools.
  3. Choose the time zone.
  4. Read what it bills on.

This page is one helperHelperA tool run for you when a model reaches for it mid-answer: a web search, a page read, a sandbox. Named opendunes:‹name›.More on Helpers →. The list of helpers, and how the charge adds up, sit in Helpers.

1. What it does

A model knows nothing of today. When a question needs the date, such as scheduling, "this week" or a deadline, the model asks the helper, reads the date and the time, and goes on.

Typeopendunes:datetime
Routes/v1/chat/completions, /v1/responses and /v1/messages
A stepone call
Stepsat most 30 a request
Bills ontokens only

2. Name it in tools

Souk Bot tells a shopkeeper how many days are left in the month. The sample asks for the time in Algiers and prints the answer and the charge.

import json
import os
import urllib.request

API_KEY = os.environ["OPENDUNES_API_KEY"]
ADDRESS = "https://opendunes.com/v1/chat/completions"
MODEL = "anthropic/claude-sonnet-4.5"
PROMPT = "How many days are left until the end of this month?"

body = {
    "model": MODEL,
    "messages": [{"role": "user", "content": PROMPT}],
    "tools": [
        {
            "type": "opendunes:datetime",
            "parameters": {"timezone": "Africa/Algiers"},
        }
    ],
    "max_tool_calls": 2,
}
request = urllib.request.Request(
    ADDRESS,
    data=json.dumps(body).encode(),
    headers={
        "Authorization": "Bearer " + API_KEY,
        "Content-Type": "application/json",
    },
)
with urllib.request.urlopen(request) as response:
    answer = json.load(response)

print(answer["choices"][0]["message"]["content"])
print(answer["usage"]["cost"])

The answer is a 200. Name the helper by its type, opendunes:datetime; any other spelling of the type is a 400.

3. Choose the time zone

Put this in the helper's parameters.

ParameterDoes
timezonean IANA time zone name, such as Africa/Algiers; left out, UTC

Pair the helper with Web search so a question about "this week" is searched with the right date.

4. Read what it bills on

No charge beyond the model's tokens. The date the helper returns is read as input, a few tokens, and the call itself adds no fee. usage.cost carries the whole of it.

Before the model starts, OpenDunes holds money from your wallet for the words and the answer. A call costs no money of its own, so the hold sets no step limit lower than yours: a request runs at most 30 steps, or the max_tool_calls you name. The helper runs no other model and no sandbox, so it has no spend cap.

Don't

Don't paste today's date into every prompt by hand. A date typed into a stored prompt goes stale.

Do

Name the helper and set timezone to your customers' own zone, so "today" means their today.