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

> ## Agent Instructions
> To act on a user's behalf in Guild, use the Guild REST API at https://api.guild.ai/v1.
> The OpenAPI spec is unauthenticated: https://docs.guild.ai/openapi.json (or openapi.yaml).
> Authenticate with an account API key, sent as HTTP Basic (key id as username, secret as password) or as `Authorization: Bearer <api_key_id>:<api_key_secret>`. See https://docs.guild.ai/api-reference/introduction#authentication.
> To run one agent on demand without account-wide access, use an API trigger instead: https://docs.guild.ai/platform/api-triggers.
> To search these docs from an MCP client, connect to https://docs.guild.ai/mcp. The full page index is https://docs.guild.ai/llms.txt.

# Get the identity of the calling credential

> An API key gets its own record, including the name of the account that owns it. An OAuth token gets the user it acts as, the client that holds it, and the scopes it was granted.



## OpenAPI

````yaml /api-reference/openapi.yaml get /me
openapi: 3.0.3
info:
  title: Guild Public API
  version: 1.0.0
  description: >-
    The Guild public API, served at https://api.guild.ai/v1. Authenticate with
    an account API key, sent as HTTP Basic (key id as the username, secret as
    the password) or as a Bearer token `<key id>:<secret>`, or with an OAuth 2.0
    access token. Each operation lists the credentials it accepts and the scopes
    it needs; see https://docs.guild.ai/api-reference/introduction#scopes.
    Versions are path integers and v1 is the only one: a breaking change ships
    as a new version rather than changing v1. Lists page with `limit` and
    `offset` and report `pagination.has_more`. A session-events websocket also
    exists at wss://api.guild.ai/v1/sessions/{session_id}/events/ws with the
    same credentials on the handshake; OpenAPI cannot describe websockets, so it
    is not listed in paths.
servers:
  - url: https://api.guild.ai/v1
    description: Production
security: []
tags:
  - name: accounts
  - name: agents
  - name: integrations
  - name: other
  - name: sessions
  - name: skills
  - name: triggers
  - name: workspaces
paths:
  /me:
    get:
      tags:
        - accounts
      summary: Get the identity of the calling credential
      description: >-
        An API key gets its own record, including the name of the account that
        owns it. An OAuth token gets the user it acts as, the client that holds
        it, and the scopes it was granted.
      operationId: get_public_me
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicMe'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - apiKey: []
        - bearerApiKey: []
        - oauth2: []
components:
  schemas:
    PublicMe:
      anyOf:
        - $ref: '#/components/schemas/ApiKey'
        - $ref: '#/components/schemas/OauthIdentity'
      description: |-
        ``/v1/me`` answers for whichever credential called it; ``type``
        tells the two apart.
      title: PublicMe
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
    ApiKey:
      description: |-
        An account API key as every key-returning endpoint serializes it. The
        one-time secret is shown only in the creation response and never appears
        in this shape.
      properties:
        id:
          format: uuid
          title: Id
          type: string
        entity_type:
          title: Entity Type
          type: string
        created_at:
          format: date-time
          title: Created At
          type: string
        updated_at:
          format: date-time
          title: Updated At
          type: string
        type:
          title: Type
          type: string
          enum:
            - account
        name:
          title: Name
          nullable: true
          type: string
        permissions:
          description: The key's scopes; write implies read.
          items:
            $ref: '#/components/schemas/ApiKeyScope'
          title: Permissions
          type: array
        owner:
          additionalProperties: true
          description: The account the key acts as (user or organization, item shape).
          title: Owner
          type: object
        created_by:
          additionalProperties: true
          description: The user who minted the key (item shape).
          title: Created By
          type: object
      required:
        - id
        - entity_type
        - created_at
        - updated_at
        - type
        - name
        - permissions
        - owner
        - created_by
      title: ApiKey
      type: object
    OauthIdentity:
      description: |-
        Who an OAuth access token acts as: the consenting user, the client
        that holds the token, and the scopes the user granted.
      properties:
        type:
          title: Type
          type: string
          enum:
            - oauth
        user:
          additionalProperties: true
          description: The consenting user (item shape).
          title: User
          type: object
        client:
          additionalProperties: true
          description: The OAuth client holding the token.
          title: Client
          type: object
        scopes:
          description: The granted scopes.
          items:
            $ref: '#/components/schemas/ApiKeyScope'
          title: Scopes
          type: array
      required:
        - type
        - user
        - client
        - scopes
      title: OauthIdentity
      type: object
    ApiKeyScope:
      properties:
        group:
          $ref: '#/components/schemas/ApiKeyScopeGroup'
        access:
          $ref: '#/components/schemas/ApiKeyScopeAccess'
      required:
        - group
        - access
      title: ApiKeyScope
      type: object
    ApiKeyScopeGroup:
      enum:
        - agents
        - sessions
        - workspaces
        - skills
        - integrations
        - tool_call
        - applications
        - organizations
      title: ApiKeyScopeGroup
      type: string
    ApiKeyScopeAccess:
      enum:
        - read
        - write
      title: ApiKeyScopeAccess
      type: string
  securitySchemes:
    apiKey:
      type: http
      scheme: basic
      description: >-
        API key: key id as the username, secret as the password. An account API
        key carries the same scopes as an OAuth token and is checked against the
        scopes listed under oauth2 on each operation. A trigger API key is
        limited to its trigger's workspace and reaches only the session
        operations that list this scheme alongside the oauth2 scopes.
    bearerApiKey:
      type: http
      scheme: bearer
      bearerFormat: <key id>:<secret>
      description: >-
        The same API key as one Bearer token, `<key id>:<secret>`. An account
        API key carries the same scopes as an OAuth token and is checked against
        the scopes listed under oauth2 on each operation. A trigger API key is
        limited to its trigger's workspace and reaches only the session
        operations that list this scheme alongside the oauth2 scopes.
    oauth2:
      type: oauth2
      description: >-
        OAuth 2.0 authorization code flow with PKCE (S256). Discovery:
        https://api.guild.ai/.well-known/oauth-authorization-server.
      flows:
        authorizationCode:
          authorizationUrl: https://api.guild.ai/v1/oauth/authorize
          tokenUrl: https://api.guild.ai/v1/oauth/token
          refreshUrl: https://api.guild.ai/v1/oauth/token
          scopes:
            agents:read: Read agents
            agents:write: Read and change agents
            sessions:read: Read sessions
            sessions:write: Read and change sessions
            workspaces:read: Read workspaces
            workspaces:write: Read and change workspaces
            skills:read: Read skills
            skills:write: Read and change skills
            integrations:read: Read integrations
            integrations:write: Read and change integrations
            applications:read: Read applications
            applications:write: Read and change applications
            organizations:read: Read organizations
            organizations:write: Read and change organizations

````