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

# Get model and tool usage for an agent job



## OpenAPI

````yaml https://platform.usecontextlayer.com/api/openapi.json get /slates/{target}/agents/{name}/jobs/{id}/usage
openapi: 3.1.0
info:
  title: ContextLayer Platform
  version: 0.1.0
servers:
  - url: https://platform.usecontextlayer.com/api
security: []
tags:
  - name: Slates
  - name: Slate routing
  - name: Slate resources
  - name: Accounts
  - name: Shared secrets
  - name: Agents
  - name: Agent jobs
paths:
  /slates/{target}/agents/{name}/jobs/{id}/usage:
    get:
      tags:
        - Agent jobs
      summary: Get model and tool usage for an agent job
      operationId: getAgentJobUsage
      parameters:
        - schema:
            type: string
            minLength: 1
          required: true
          name: name
          in: path
        - schema:
            anyOf:
              - type: string
                format: uuid
              - type: string
          required: true
          name: target
          in: path
        - schema:
            type: string
            format: uuid
          required: true
          name: id
          in: path
      responses:
        '200':
          description: Native Pi model and tool usage across the job conversations
          content:
            application/json:
              schema:
                type: object
                properties:
                  models:
                    type: object
                    additionalProperties:
                      type: object
                      properties:
                        cacheRead:
                          type: number
                        cacheWrite:
                          type: number
                        cacheWrite1h:
                          type: number
                        cost:
                          type: object
                          properties:
                            cacheRead:
                              type: number
                            cacheWrite:
                              type: number
                            input:
                              type: number
                            output:
                              type: number
                            total:
                              type: number
                          required:
                            - cacheRead
                            - cacheWrite
                            - input
                            - output
                            - total
                          additionalProperties: {}
                        input:
                          type: number
                        output:
                          type: number
                        reasoning:
                          type: number
                        totalTokens:
                          type: number
                      required:
                        - cacheRead
                        - cacheWrite
                        - cost
                        - input
                        - output
                        - totalTokens
                      additionalProperties: {}
                  tools:
                    type: object
                    additionalProperties:
                      type: object
                      properties:
                        cacheRead:
                          type: number
                        cacheWrite:
                          type: number
                        cacheWrite1h:
                          type: number
                        cost:
                          type: object
                          properties:
                            cacheRead:
                              type: number
                            cacheWrite:
                              type: number
                            input:
                              type: number
                            output:
                              type: number
                            total:
                              type: number
                          required:
                            - cacheRead
                            - cacheWrite
                            - input
                            - output
                            - total
                          additionalProperties: {}
                        input:
                          type: number
                        output:
                          type: number
                        reasoning:
                          type: number
                        totalTokens:
                          type: number
                      required:
                        - cacheRead
                        - cacheWrite
                        - cost
                        - input
                        - output
                        - totalTokens
                      additionalProperties: {}
                required:
                  - models
                  - tools
                additionalProperties: {}
        '400':
          description: Invalid slate target, agent name, or job ID
        '401':
          description: A valid ContextLayer login is required
        '403':
          description: Only the Owner or owning organization members may inspect execution
        '404':
          description: Slate or agent job not found
      security:
        - bearerAuth: []
        - webCookie: []
        - localWebCookie: []
components:
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http
    webCookie:
      in: cookie
      name: __Secure-better-auth.session_token
      type: apiKey
    localWebCookie:
      in: cookie
      name: better-auth.session_token
      type: apiKey

````

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