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

# API Key Management

> Check when your API keys expire and set up alerts without signing in to the website.

## Plan Access

| Plan | Available |
| - | :-: |
| Free | ✅ |
| Starter | ✅ |
| Professional | ✅ |
| Full-Market Plans (A-Shares, HK Stocks, US Stocks) | ✅ |
| Enterprise | ✅ |

Use your API key to check expiration times and remaining seconds for the keys under your account, without signing in to the website.

## Request parameters

This endpoint has no query parameters.

## Example request

```bash theme={null}
curl -H "X-API-Key: YOUR_API_KEY" \
  "https://api.tickdb.ai/v1/apikeys/subscriptions"
```

## Response fields

The fields below are inside `data`; an outer `code` of `0` indicates success.

| Field | Description |
| - | - |
| server\_time | Server time of this request, as a date-time string with a time zone. |
| total | Number of API keys returned. |
| api\_keys | API keys under the account. |
| └─ key\_prefix | Prefix used to identify the key; this is not the complete key. |
| └─ name | API key name. |
| └─ plan | Plan identifier associated with the key. |
| └─ status | Key status: `active`, `expired`, `suspended`, or `revoked`. |
| └─ expires\_at | Expiration time, or `null` if no expiration is set. |
| └─ remaining\_seconds | Seconds until expiration; `0` if expired, or `null` if no expiration is set. |
| └─ created\_at | API key creation time. |


## OpenAPI

````yaml openapi.en.yaml GET /v1/apikeys/subscriptions
openapi: 3.1.0
info:
  title: TickDB API
  description: TickDB unified real-time market data API via REST and WebSocket.
  version: 1.0.3
  contact:
    email: support@tickdb.ai
servers:
  - url: https://api.tickdb.ai
    description: Production server
security:
  - ApiKeyAuth: []
paths:
  /v1/apikeys/subscriptions:
    get:
      tags:
        - account
      summary: API Key Management
      description: >-
        Check when your API keys expire and set up alerts without signing in to
        the website.
      operationId: getAPIKeyStatus
      responses:
        '200':
          $ref: '#/components/responses/APIKeyStatusResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
components:
  responses:
    APIKeyStatusResponse:
      description: API Key Management response.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/APIKeyStatusEnvelope'
    ErrorResponse:
      description: >-
        Error response. Common HTTP statuses include 400 (invalid parameters),
        401 (authentication failed), 403 (permission or quota restriction), 404
        (no matching data), 429 (rate limit), and 503 (service temporarily
        unavailable).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          examples:
            missingAPIKey:
              summary: Missing API key
              value:
                code: '1002'
                message: API key is required. Provide via X-API-Key header
                error: '1002'
            missingKind:
              summary: Missing required parameter
              value:
                code: 40001
                message: kind is required
                data: null
            endpointForbidden:
              summary: API key cannot access this endpoint
              value:
                code: 3009
                message: This endpoint is not allowed for your API key
                data: null
            marketForbidden:
              summary: API key cannot access this market
              value:
                code: 3010
                message: Fundamentals market not allowed for your API key
                data:
                  market: US
            noAvailableSource:
              summary: Data temporarily unavailable
              value:
                code: 5003
                message: Data is temporarily unavailable
                data: null
            notFound:
              summary: No matching data
              value:
                code: 40404
                message: shareholder detail not found
                data: null
            businessNoData:
              summary: No business data matches the query
              value:
                code: 40405
                message: valuation time series not found
                data: null
  schemas:
    APIKeyStatusEnvelope:
      allOf:
        - $ref: '#/components/schemas/SuccessEnvelope'
        - type: object
          required:
            - data
          properties:
            message:
              type: string
              description: Response message.
            data:
              $ref: '#/components/schemas/APIKeyStatusData'
    ErrorEnvelope:
      type: object
      required:
        - code
        - message
      properties:
        code:
          description: >-
            TickDB API business error code; may be an integer or string. Convert
            it to a string before comparing.
          oneOf:
            - type: integer
            - type: string
        message:
          type: string
          description: Error description.
        error:
          type: string
          description: >-
            Compatibility error identifier; present only in some error
            responses.
        data:
          description: Optional error context; may be null, an object, or an array.
          oneOf:
            - type: 'null'
            - type: object
              additionalProperties: true
            - type: array
              items: {}
    SuccessEnvelope:
      type: object
      required:
        - code
        - data
      properties:
        code:
          type: integer
          const: 0
          description: Business status code; `0` means success.
    APIKeyStatusData:
      type: object
      required:
        - server_time
        - total
        - api_keys
      properties:
        server_time:
          type: string
          format: date-time
          description: Server time of this request, as a date-time string with a time zone.
        total:
          type: integer
          minimum: 0
          description: Number of API keys returned.
        api_keys:
          type: array
          description: API keys under the account.
          items:
            $ref: '#/components/schemas/APIKeyStatusItem'
      additionalProperties: false
    APIKeyStatusItem:
      type: object
      required:
        - key_prefix
        - name
        - plan
        - status
        - expires_at
        - remaining_seconds
        - created_at
      properties:
        key_prefix:
          type: string
          description: Prefix used to identify the key; this is not the complete key.
        name:
          type: string
          description: API key name.
        plan:
          type: string
          description: Plan identifier associated with the key.
        status:
          type: string
          enum:
            - active
            - expired
            - suspended
            - revoked
          description: 'Key status: `active`, `expired`, `suspended`, or `revoked`.'
        expires_at:
          type:
            - string
            - 'null'
          format: date-time
          description: Expiration time, or `null` if no expiration is set.
        remaining_seconds:
          type:
            - integer
            - 'null'
          minimum: 0
          description: >-
            Seconds until expiration; `0` if expired, or `null` if no expiration
            is set.
        created_at:
          type: string
          format: date-time
          description: API key creation time.
      additionalProperties: false
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.