For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
ModelsChatRankingsDocs
DocsAPI ReferenceClient SDKsAgent SDKCookbookChangelog
DocsAPI ReferenceClient SDKsAgent SDKCookbookChangelog
  • Overview
    • Quickstart
    • Principles
    • Models
    • Stripe Projects
    • FAQ
    • Report Feedback
  • Models & Routing
    • Model Fallbacks
    • Provider Selection
    • Auto Exacto
    • Private Models
  • Features
    • Workspaces
    • Presets
    • Response Caching
    • Tool Calling
      • Overview
      • Web Search
      • Web Fetch
      • Datetime
      • Image Generation
      • Fusion
    • Structured Outputs
    • Message Transforms
    • Zero Completion Insurance
    • ZDR
    • App Attribution
    • Service Tiers
    • Sovereign AI
    • Router Metadata
    • Input & Output Logging
LogoLogo
ModelsChatRankingsDocs
On this page
  • Quick Start
  • Configuration
  • Response
  • Pricing
  • Next Steps
FeaturesServer Tools

Datetime

Beta
Give any model access to the current date and time
Was this page helpful?
Previous

Image Generation

Generate images from text prompts with any model
Next
Built with
Beta

Server tools are currently in beta. The API and behavior may change.

The openrouter:datetime server tool gives any model access to the current date and time. This is useful for prompts that require temporal awareness — scheduling, time-sensitive questions, or any task where the model needs to know “right now.”

Quick Start

1const response = await fetch('https://openrouter.ai/api/v1/chat/completions', {
2 method: 'POST',
3 headers: {
4 Authorization: 'Bearer {{API_KEY_REF}}',
5 'Content-Type': 'application/json',
6 },
7 body: JSON.stringify({
8 model: '{{MODEL}}',
9 messages: [
10 {
11 role: 'user',
12 content: 'What day of the week is it today?'
13 }
14 ],
15 tools: [
16 { type: 'openrouter:datetime' }
17 ]
18 }),
19});
20
21const data = await response.json();
22console.log(data.choices[0].message.content);

Configuration

The datetime tool accepts an optional timezone parameter:

1{
2 "type": "openrouter:datetime",
3 "parameters": {
4 "timezone": "America/New_York"
5 }
6}
ParameterTypeDefaultDescription
timezonestringUTCIANA timezone name (e.g. "America/New_York", "Europe/London", "Asia/Tokyo")

Response

When the model calls the datetime tool, it receives a response like:

1{
2 "datetime": "2025-07-15T14:30:00.000-04:00",
3 "timezone": "America/New_York"
4}

Pricing

The datetime tool has no additional cost beyond standard token usage.

Next Steps

  • Server Tools Overview — Learn about server tools
  • Web Search — Search the web for real-time information
  • Tool Calling — Learn about user-defined tool calling