> ## Documentation Index
> Fetch the complete documentation index at: https://opentools.page/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# get_clock

> Return the current Alpaca market clock.

## alpaca\_get\_clock

```python
tools = trading.alpaca(
    api_key=os.environ["ALPACA_KEY"],
    api_secret=os.environ["ALPACA_SECRET"],
    model="openai",
    paper=True,
    minimal=True,
    include=["alpaca_get_clock"],
)
```

**Options**

* `include` / `exclude`: filter which tools are exposed (use full names like `alpaca_get_clock`).
* `minimal`: omit `provider` and `provider_fields` when `True`.
* `paper`: use Alpaca paper trading instead of live trading.


## OpenAPI

````yaml api-reference/openapi.json get /tools/alpaca/get_clock
openapi: 3.1.0
info:
  title: OpenTools Trading Tools
  version: 0.1.0
  description: >-
    Reference for OpenTools trading tool calls. These are SDK tools, documented
    as virtual endpoints for clarity.
servers: []
security: []
tags:
  - name: Alpaca
    description: >-
      Read-only account + assets + clock + orders + portfolio history +
      positions.
  - name: Coinbase
    description: >-
      Accounts + portfolios + portfolio breakdown + positions (derived) +
      brokerage products + orders (if available).
paths:
  /tools/alpaca/get_clock:
    get:
      tags:
        - Alpaca
      summary: get_clock
      description: Return the current Alpaca market clock.
      operationId: alpaca_get_clock
      requestBody:
        required: false
        description: This is a request to obtain information. Your API keys are required.
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              description: ''
            example: {}
      responses:
        '200':
          description: Clock (OpenTools trading schema).
          content:
            application/json:
              schema:
                type: object
                additionalProperties: false
                description: ''
                properties:
                  provider:
                    type:
                      - string
                      - 'null'
                    description: Trading provider identifier. Omitted when minimal=True.
                  timestamp:
                    type:
                      - string
                      - 'null'
                    format: date-time
                    description: >-
                      Current provider timestamp at the time the clock was
                      queried.
                  is_open:
                    type:
                      - boolean
                      - 'null'
                    description: Whether the market is currently open.
                  next_open:
                    type:
                      - string
                      - 'null'
                    format: date-time
                    description: Timestamp of the next market open.
                  next_close:
                    type:
                      - string
                      - 'null'
                    format: date-time
                    description: Timestamp of the next market close.
                  provider_fields:
                    type: object
                    additionalProperties: true
                    description: >-
                      Additional provider-specific fields. Omitted when
                      minimal=True.
        '401':
          description: Unauthorized (missing/invalid credentials).
          content:
            application/json:
              schema:
                type: object
                additionalProperties: false
                properties:
                  message:
                    type: string
                  domain:
                    type: string
                  provider:
                    type: string
                  details: {}
                required:
                  - message
        '429':
          description: Rate limited by provider or transport.
          content:
            application/json:
              schema:
                type: object
                additionalProperties: false
                properties:
                  message:
                    type: string
                  domain:
                    type: string
                  provider:
                    type: string
                  details: {}
                required:
                  - message
      x-codeSamples:
        - lang: python
          label: Python
          source: |
            import os
            from opentools import trading

            tools = trading.alpaca(
                api_key=os.environ["ALPACA_KEY"],
                api_secret=os.environ["ALPACA_SECRET"],
                model="openai",
                paper=True,
                minimal=True,
                include=["alpaca_get_clock"],
            )

````