timezone-agent

Returns the current date and time for a supplied IANA timezone.

Entrypoints

Explore the capabilities exposed by this agent. Invoke with JSON, stream responses when available, and inspect pricing where monetization applies.

current-time

Invoke

Fetches the current date and time for the requested timezone.

Pricing Invoke: $0.01
Network base
Invoke Endpoint POST /entrypoints/current-time/invoke
Input Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "timeZone": {
      "description": "IANA timezone identifier, e.g. America/Denver.",
      "type": "string",
      "minLength": 1
    }
  },
  "required": [
    "timeZone"
  ],
  "additionalProperties": false
}
Invoke with curl
curl -s -X POST \
  'http://tz-agent.daydreams.systems/entrypoints/current-time/invoke' \
  -H 'Content-Type: application/json' \
  -d '
    {
      "input": {
        "timeZone": "string"
      }
    }
  '

current-time-by-coordinate

Invoke

Fetches the current date and time for the supplied geographic coordinates.

Pricing Invoke: $0.01
Network base
Invoke Endpoint POST /entrypoints/current-time-by-coordinate/invoke
Input Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "latitude": {
      "description": "Latitude in decimal degrees ranging from -90 to 90.",
      "type": "number",
      "minimum": -90,
      "maximum": 90
    },
    "longitude": {
      "description": "Longitude in decimal degrees ranging from -180 to 180.",
      "type": "number",
      "minimum": -180,
      "maximum": 180
    }
  },
  "required": [
    "latitude",
    "longitude"
  ],
  "additionalProperties": false
}
Invoke with curl
curl -s -X POST \
  'http://tz-agent.daydreams.systems/entrypoints/current-time-by-coordinate/invoke' \
  -H 'Content-Type: application/json' \
  -d '
    {
      "input": {
        "latitude": -90,
        "longitude": -180
      }
    }
  '

current-time-by-ip

Invoke

Fetches the current date and time by looking up the supplied IPv4 address.

Pricing Invoke: $0.01
Network base
Invoke Endpoint POST /entrypoints/current-time-by-ip/invoke
Input Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ipAddress": {
      "description": "IPv4 address, e.g. 237.71.232.203.",
      "type": "string",
      "pattern": "^(?:(?:25[0-5]|2[0-4]\\d|1?\\d?\\d)\\.){3}(?:25[0-5]|2[0-4]\\d|1?\\d?\\d)$"
    }
  },
  "required": [
    "ipAddress"
  ],
  "additionalProperties": false
}
Invoke with curl
curl -s -X POST \
  'http://tz-agent.daydreams.systems/entrypoints/current-time-by-ip/invoke' \
  -H 'Content-Type: application/json' \
  -d '
    {
      "input": {
        "ipAddress": "string"
      }
    }
  '

available-timezones

Invoke

Lists all available IANA timezones.

Pricing Invoke: $0.01
Network base
Invoke Endpoint POST /entrypoints/available-timezones/invoke
Input Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "description": "No input required.",
  "type": "object",
  "properties": {},
  "additionalProperties": false
}
Invoke with curl
curl -s -X POST \
  'http://tz-agent.daydreams.systems/entrypoints/available-timezones/invoke' \
  -H 'Content-Type: application/json' \
  -d '
    {
      "input": {}
    }
  '

timezone-info

Invoke

Gets detailed timezone information for the supplied IANA timezone name.

Pricing Invoke: $0.01
Network base
Invoke Endpoint POST /entrypoints/timezone-info/invoke
Input Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "timeZone": {
      "description": "IANA timezone identifier, e.g. America/Denver.",
      "type": "string",
      "minLength": 1
    }
  },
  "required": [
    "timeZone"
  ],
  "additionalProperties": false
}
Invoke with curl
curl -s -X POST \
  'http://tz-agent.daydreams.systems/entrypoints/timezone-info/invoke' \
  -H 'Content-Type: application/json' \
  -d '
    {
      "input": {
        "timeZone": "string"
      }
    }
  '

timezone-info-by-coordinate

Invoke

Gets timezone information for the supplied geographic coordinates.

Pricing Invoke: $0.01
Network base
Invoke Endpoint POST /entrypoints/timezone-info-by-coordinate/invoke
Input Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "latitude": {
      "description": "Latitude in decimal degrees ranging from -90 to 90.",
      "type": "number",
      "minimum": -90,
      "maximum": 90
    },
    "longitude": {
      "description": "Longitude in decimal degrees ranging from -180 to 180.",
      "type": "number",
      "minimum": -180,
      "maximum": 180
    }
  },
  "required": [
    "latitude",
    "longitude"
  ],
  "additionalProperties": false
}
Invoke with curl
curl -s -X POST \
  'http://tz-agent.daydreams.systems/entrypoints/timezone-info-by-coordinate/invoke' \
  -H 'Content-Type: application/json' \
  -d '
    {
      "input": {
        "latitude": -90,
        "longitude": -180
      }
    }
  '

timezone-info-by-ip

Invoke

Gets timezone information by looking up the supplied IPv4 address.

Pricing Invoke: $0.01
Network base
Invoke Endpoint POST /entrypoints/timezone-info-by-ip/invoke
Input Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ipAddress": {
      "description": "IPv4 address, e.g. 237.71.232.203.",
      "type": "string",
      "pattern": "^(?:(?:25[0-5]|2[0-4]\\d|1?\\d?\\d)\\.){3}(?:25[0-5]|2[0-4]\\d|1?\\d?\\d)$"
    }
  },
  "required": [
    "ipAddress"
  ],
  "additionalProperties": false
}
Invoke with curl
curl -s -X POST \
  'http://tz-agent.daydreams.systems/entrypoints/timezone-info-by-ip/invoke' \
  -H 'Content-Type: application/json' \
  -d '
    {
      "input": {
        "ipAddress": "string"
      }
    }
  '

convert-timezone

Invoke

Converts a date/time from one timezone to another.

Pricing Invoke: $0.01
Network base
Invoke Endpoint POST /entrypoints/convert-timezone/invoke
Input Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "fromTimeZone": {
      "description": "Source IANA timezone identifier, e.g. Europe/Amsterdam.",
      "type": "string",
      "minLength": 1
    },
    "dateTime": {
      "description": "Date/time formatted as yyyy-MM-dd HH:mm:ss[.ffffff].",
      "type": "string",
      "minLength": 1
    },
    "toTimeZone": {
      "description": "Target IANA timezone identifier, e.g. America/Los_Angeles.",
      "type": "string",
      "minLength": 1
    },
    "dstAmbiguity": {
      "description": "When ambiguous due to DST transitions, choose 'earlier', 'later', or leave blank.",
      "anyOf": [
        {
          "type": "string",
          "const": "earlier"
        },
        {
          "type": "string",
          "const": "later"
        },
        {
          "type": "string",
          "const": ""
        }
      ]
    }
  },
  "required": [
    "fromTimeZone",
    "dateTime",
    "toTimeZone"
  ],
  "additionalProperties": false
}
Invoke with curl
curl -s -X POST \
  'http://tz-agent.daydreams.systems/entrypoints/convert-timezone/invoke' \
  -H 'Content-Type: application/json' \
  -d '
    {
      "input": {
        "fromTimeZone": "string",
        "dateTime": "string",
        "toTimeZone": "string",
        "dstAmbiguity": "earlier"
      }
    }
  '

translate-datetime

Invoke

Translates a date/time into a friendly localized string using.

Pricing Invoke: $0.01
Network base
Invoke Endpoint POST /entrypoints/translate-datetime/invoke
Input Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "dateTime": {
      "description": "Date/time formatted as yyyy-MM-dd HH:mm:ss[.ffffff].",
      "type": "string",
      "minLength": 1
    },
    "languageCode": {
      "description": "Two-letter ISO 639-1 language code, e.g. en.",
      "type": "string",
      "pattern": "^[a-z]{2}$"
    }
  },
  "required": [
    "dateTime",
    "languageCode"
  ],
  "additionalProperties": false
}
Invoke with curl
curl -s -X POST \
  'http://tz-agent.daydreams.systems/entrypoints/translate-datetime/invoke' \
  -H 'Content-Type: application/json' \
  -d '
    {
      "input": {
        "dateTime": "string",
        "languageCode": "string"
      }
    }
  '

day-of-week

Invoke

Resolves the supplied date to the day of the week.

Pricing Invoke: $0.01
Network base
Invoke Endpoint POST /entrypoints/day-of-week/invoke
Input Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "date": {
      "description": "Date formatted as yyyy-MM-dd.",
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
    }
  },
  "required": [
    "date"
  ],
  "additionalProperties": false
}
Invoke with curl
curl -s -X POST \
  'http://tz-agent.daydreams.systems/entrypoints/day-of-week/invoke' \
  -H 'Content-Type: application/json' \
  -d '
    {
      "input": {
        "date": "string"
      }
    }
  '

day-of-year

Invoke

Calculates the ordinal day of the year for the supplied date.

Pricing Invoke: $0.01
Network base
Invoke Endpoint POST /entrypoints/day-of-year/invoke
Input Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "date": {
      "description": "Date formatted as yyyy-MM-dd.",
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
    }
  },
  "required": [
    "date"
  ],
  "additionalProperties": false
}
Invoke with curl
curl -s -X POST \
  'http://tz-agent.daydreams.systems/entrypoints/day-of-year/invoke' \
  -H 'Content-Type: application/json' \
  -d '
    {
      "input": {
        "date": "string"
      }
    }
  '

increment-current-time

Invoke

Increments the current time in a timezone by a timespan.

Pricing Invoke: $0.01
Network base
Invoke Endpoint POST /entrypoints/increment-current-time/invoke
Input Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "timeZone": {
      "description": "IANA timezone identifier, e.g. America/Denver.",
      "type": "string",
      "minLength": 1
    },
    "timeSpan": {
      "description": "Timespan formatted as d:hh:mm:ss or d:hh:mm:ss.fff (d=days).",
      "type": "string",
      "minLength": 1
    }
  },
  "required": [
    "timeZone",
    "timeSpan"
  ],
  "additionalProperties": false
}
Invoke with curl
curl -s -X POST \
  'http://tz-agent.daydreams.systems/entrypoints/increment-current-time/invoke' \
  -H 'Content-Type: application/json' \
  -d '
    {
      "input": {
        "timeZone": "string",
        "timeSpan": "string"
      }
    }
  '

decrement-current-time

Invoke

Decrements the current time in a timezone by a timespan.

Pricing Invoke: $0.01
Network base
Invoke Endpoint POST /entrypoints/decrement-current-time/invoke
Input Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "timeZone": {
      "description": "IANA timezone identifier, e.g. America/Denver.",
      "type": "string",
      "minLength": 1
    },
    "timeSpan": {
      "description": "Timespan formatted as d:hh:mm:ss or d:hh:mm:ss.fff (d=days).",
      "type": "string",
      "minLength": 1
    }
  },
  "required": [
    "timeZone",
    "timeSpan"
  ],
  "additionalProperties": false
}
Invoke with curl
curl -s -X POST \
  'http://tz-agent.daydreams.systems/entrypoints/decrement-current-time/invoke' \
  -H 'Content-Type: application/json' \
  -d '
    {
      "input": {
        "timeZone": "string",
        "timeSpan": "string"
      }
    }
  '

increment-custom-time

Invoke

Increments a custom date/time in a timezone by a timespan.

Pricing Invoke: $0.01
Network base
Invoke Endpoint POST /entrypoints/increment-custom-time/invoke
Input Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "timeZone": {
      "description": "IANA timezone identifier, e.g. America/Denver.",
      "type": "string",
      "minLength": 1
    },
    "dateTime": {
      "description": "Date/time formatted as yyyy-MM-dd HH:mm:ss[.ffffff].",
      "type": "string",
      "minLength": 1
    },
    "timeSpan": {
      "description": "Timespan formatted as d:hh:mm:ss or d:hh:mm:ss.fff (d=days).",
      "type": "string",
      "minLength": 1
    },
    "dstAmbiguity": {
      "description": "When ambiguous due to DST transitions, choose 'earlier', 'later', or leave blank.",
      "anyOf": [
        {
          "type": "string",
          "const": "earlier"
        },
        {
          "type": "string",
          "const": "later"
        },
        {
          "type": "string",
          "const": ""
        }
      ]
    }
  },
  "required": [
    "timeZone",
    "dateTime",
    "timeSpan"
  ],
  "additionalProperties": false
}
Invoke with curl
curl -s -X POST \
  'http://tz-agent.daydreams.systems/entrypoints/increment-custom-time/invoke' \
  -H 'Content-Type: application/json' \
  -d '
    {
      "input": {
        "timeZone": "string",
        "dateTime": "string",
        "timeSpan": "string",
        "dstAmbiguity": "earlier"
      }
    }
  '

decrement-custom-time

Invoke

Decrements a custom date/time in a timezone by a timespan.

Pricing Invoke: $0.01
Network base
Invoke Endpoint POST /entrypoints/decrement-custom-time/invoke
Input Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "timeZone": {
      "description": "IANA timezone identifier, e.g. America/Denver.",
      "type": "string",
      "minLength": 1
    },
    "dateTime": {
      "description": "Date/time formatted as yyyy-MM-dd HH:mm:ss[.ffffff].",
      "type": "string",
      "minLength": 1
    },
    "timeSpan": {
      "description": "Timespan formatted as d:hh:mm:ss or d:hh:mm:ss.fff (d=days).",
      "type": "string",
      "minLength": 1
    },
    "dstAmbiguity": {
      "description": "When ambiguous due to DST transitions, choose 'earlier', 'later', or leave blank.",
      "anyOf": [
        {
          "type": "string",
          "const": "earlier"
        },
        {
          "type": "string",
          "const": "later"
        },
        {
          "type": "string",
          "const": ""
        }
      ]
    }
  },
  "required": [
    "timeZone",
    "dateTime",
    "timeSpan"
  ],
  "additionalProperties": false
}
Invoke with curl
curl -s -X POST \
  'http://tz-agent.daydreams.systems/entrypoints/decrement-custom-time/invoke' \
  -H 'Content-Type: application/json' \
  -d '
    {
      "input": {
        "timeZone": "string",
        "dateTime": "string",
        "timeSpan": "string",
        "dstAmbiguity": "earlier"
      }
    }
  '

health-check

Invoke

Runs the health check endpoint.

Pricing Invoke: $0.01
Network base
Invoke Endpoint POST /entrypoints/health-check/invoke
Input Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "description": "No input required.",
  "type": "object",
  "properties": {},
  "additionalProperties": false
}
Invoke with curl
curl -s -X POST \
  'http://tz-agent.daydreams.systems/entrypoints/health-check/invoke' \
  -H 'Content-Type: application/json' \
  -d '
    {
      "input": {}
    }
  '

Client Example: x402-fetch

Use the x402-fetch helpers to wrap a standard fetch call and automatically attach payments. This script loads configuration from .env, pays the facilitator, and logs both the response body and the decoded payment receipt.

import { config } from "dotenv";
import {
  decodeXPaymentResponse,
  wrapFetchWithPayment,
  createSigner,
  type Hex,
} from "x402-fetch";

config();

const privateKey = process.env.PRIVATE_KEY as Hex | string;
const baseURL = process.env.RESOURCE_SERVER_URL as string; // e.g. https://example.com
const endpointPath = process.env.ENDPOINT_PATH as string; // e.g. /weather
const url = `${baseURL}${endpointPath}`; // e.g. https://example.com/weather

if (!baseURL || !privateKey || !endpointPath) {
  console.error("Missing required environment variables");
  process.exit(1);
}

/**
 * Demonstrates paying for a protected resource using x402-fetch.
 *
 * Required environment variables:
 * - PRIVATE_KEY            Signer private key
 * - RESOURCE_SERVER_URL    Base URL of the agent
 * - ENDPOINT_PATH          Endpoint path (e.g. /entrypoints/echo/invoke)
 */
async function main(): Promise<void> {
  // const signer = await createSigner("solana-devnet", privateKey); // uncomment for Solana
  const signer = await createSigner("base-sepolia", privateKey);
  const fetchWithPayment = wrapFetchWithPayment(fetch, signer);

  const response = await fetchWithPayment(url, { method: "GET" });
  const body = await response.json();
  console.log(body);

  const paymentResponse = decodeXPaymentResponse(
    response.headers.get("x-payment-response")!
  );
  console.log(paymentResponse);
}

main().catch((error) => {
  console.error(error?.response?.data?.error ?? error);
  process.exit(1);
});