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

# Account details

> Get information about the account associated with the provided API key



## OpenAPI

````yaml /openapi-v1.json get /v1/user/account
openapi: 3.0.3
info:
  termsOfService: https://platform.stability.ai/docs/terms-of-service
  description: >
    Welcome to the official Stability AI REST API!


    #### Authentication


    You will need your [Stability API
    key](https://platform.stability.ai/dashboard/api-keys) in order to make
    requests to this API.

    Make sure you never share your API key with anyone, and you never commit it
    to a public repository. Include this key in 

    the `Authorization` header of your requests.


    #### Rate limiting


    This API is rate-limited to 150 requests every 10 seconds. If you exceed
    this limit, you will receive a `429` response.

    If you find this limit too restrictive, please reach out to us via email at
    [platform@stability.ai](mailto:platform@stability.ai).


    #### Support


    Check our [Status Page](https://stabilityai.instatus.com/) to view the
    current health of our REST/gRPC APIs.


    If you run into issues, please reach out to us:
      - [Support Form](https://platform.stability.ai/support)
      - [platform@stability.ai](mailto:platform@stability.ai) 
      - [Discord](https://discord.com/channels/1002292111942635562/1042896447311454361)
  title: Stability.ai REST API
  version: v1
  x-logo:
    altText: Stability.ai REST API
    url: /docs/StabilityLogo.png
servers:
  - url: https://api.stability.ai
security: []
tags:
  - name: User
    description: Manage your Stability account, and view account/organization balances.
  - name: Engines
    description: Enumerate engines that work with 'Version 1' REST API endpoints.
  - name: SDXL 1.0
    description: Generate images using SDXL 1.0.
paths:
  /v1/user/account:
    get:
      tags:
        - User
      summary: Account details
      description: Get information about the account associated with the provided API key
      operationId: userAccount
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccountResponseBody'
          description: OK response.
        '401':
          $ref: '#/components/responses/401'
        '500':
          $ref: '#/components/responses/500'
      security:
        - STABILITY_API_KEY: []
      x-codeSamples:
        - label: Python
          lang: python
          source: |+
            import os
            import requests

            api_host = os.getenv('API_HOST', 'https://api.stability.ai')
            url = f"{api_host}/v1/user/account"

            api_key = os.getenv("STABILITY_API_KEY")
            if api_key is None:
                raise Exception("Missing Stability API key.")

            response = requests.get(url, headers={
                "Authorization": f"Bearer {api_key}"
            })

            if response.status_code != 200:
                raise Exception("Non-200 response: " + str(response.text))

            # Do something with the payload...
            payload = response.json()

        - label: TypeScript
          lang: javascript
          source: |
            import fetch from 'node-fetch'

            const apiHost = process.env.API_HOST ?? 'https://api.stability.ai'
            const url = `${apiHost}/v1/user/account`

            const apiKey = process.env.STABILITY_API_KEY
            if (!apiKey) throw new Error('Missing Stability API key.')

            const response = await fetch(url, {
              method: 'GET',
              headers: {
                Authorization: `Bearer ${apiKey}`,
              },
            })

            if (!response.ok) {
              throw new Error(`Non-200 response: ${await response.text()}`)
            }

            interface User {
              id: string
              profile_picture: string
              email: string
              organizations?: Array<{
                id: string
                name: string
                role: string
                is_default: boolean
              }>
            }

            // Do something with the user...
            const user = (await response.json()) as User
        - label: Go
          lang: go
          source: "package main\n\nimport (\n\t\"io\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\t// Build REST endpoint URL\n\tapiHost, hasApiHost := os.LookupEnv(\"API_HOST\")\n\tif !hasApiHost {\n\t\tapiHost = \"https://api.stability.ai\"\n\t}\n\treqUrl := apiHost + \"/v1/user/account\"\n\n\t// Acquire an API key from the environment\n\tapiKey, hasAPIKey := os.LookupEnv(\"STABILITY_API_KEY\")\n\tif !hasAPIKey {\n\t\tpanic(\"Missing STABILITY_API_KEY environment variable\")\n\t}\n\n\t// Build the request\n\treq, _ := http.NewRequest(\"GET\", reqUrl, nil)\n\treq.Header.Add(\"Authorization\", \"Bearer \"+apiKey)\n\n\t// Execute the request\n\tres, _ := http.DefaultClient.Do(req)\n\tdefer res.Body.Close()\n\tbody, _ := io.ReadAll(res.Body)\n\n\tif res.StatusCode != 200 {\n\t\tpanic(\"Non-200 response: \" + string(body))\n\t}\n\n\t// Do something with the payload...\n\t// payload := string(body)\n}\n"
        - label: cURL
          lang: bash
          source: |
            if [ -z "$STABILITY_API_KEY" ]; then
                echo "STABILITY_API_KEY environment variable is not set"
                exit 1
            fi

            # Determine the URL to use for the request
            BASE_URL=${API_HOST:-https://api.stability.ai}
            URL="$BASE_URL/v1/user/account"

            curl -f -sS "$URL" \
              -H 'Accept: application/json' \
              -H "Authorization: Bearer $STABILITY_API_KEY"
components:
  schemas:
    AccountResponseBody:
      type: object
      properties:
        email:
          type: string
          description: The user's email
          example: example@stability.ai
          format: email
        id:
          type: string
          description: The user's ID
          example: user-1234
          x-go-name: ID
        organizations:
          type: array
          example:
            - id: org-5678
              name: Another Organization
              role: MEMBER
              is_default: true
            - id: org-1234
              name: My Organization
              role: MEMBER
              is_default: false
          items:
            $ref: '#/components/schemas/OrganizationMembership'
          description: The user's organizations
        profile_picture:
          type: string
          description: The user's profile picture
          example: https://api.stability.ai/example.png
          format: uri
      required:
        - id
        - email
        - organizations
    OrganizationMembership:
      type: object
      properties:
        id:
          type: string
          example: org-123456
          x-go-name: ID
        is_default:
          type: boolean
          example: false
        name:
          type: string
          example: My Organization
        role:
          type: string
          example: MEMBER
      required:
        - id
        - name
        - role
        - is_default
    Error:
      type: object
      x-go-name: RESTError
      properties:
        id:
          x-go-name: ID
          type: string
          description: A unique identifier for this particular occurrence of the problem.
          example: 296a972f-666a-44a1-a3df-c9c28a1f56c0
        name:
          type: string
          description: The short-name of this class of errors e.g. `bad_request`.
          example: bad_request
        message:
          type: string
          description: >-
            A human-readable explanation specific to this occurrence of the
            problem.
          example: Header parameter Authorization is required, but not found
      required:
        - name
        - id
        - message
        - status
  responses:
    '401':
      description: 'unauthorized: API key missing or invalid'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            id: 9160aa70-222f-4a36-9eb7-475e2668362a
            name: unauthorized
            message: missing authorization header
    '500':
      description: 'server_error: Some unexpected server error occurred'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            id: f81964d6-619b-453e-97bc-9fd7ac3f04e7
            name: server_error
            message: An unexpected server error occurred, please try again.
  securitySchemes:
    STABILITY_API_KEY:
      type: http
      scheme: bearer
      description: >-
        Your [Stability API
        key](https://platform.stability.ai/dashboard/api-keys), sent as a bearer
        token in the `Authorization` header.

````