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

# Agent status

> Check an agent run and read its answer.

```bash cURL theme={null}
curl https://api.stophy.dev/v1/agent/job_4kxytfWzbr774qn3-Ju4Qw \
  -H "Authorization: Bearer $STOPHY_API_KEY"
```

```json 200 theme={null}
{
  "success": true,
  "data": {
    "file": "bunfig.toml"
  },
  "status": "completed",
  "confidence": {
    "file": 0.8074
  },
  "sources": {
    "file": {
      "url": "https://bun.com/docs/runtime/bunfig",
      "quote": "›Core Runtime Copy page bunfig.toml Configure Bun's behavior using its configuration file bunfig.toml bunfig.toml is…"
    }
  },
  "stoppedBy": "done",
  "model": "spark-2",
  "mode": "extract",
  "effort": "high",
  "threadId": "job_4kxytfWzbr774qn3-Ju4Qw",
  "threadTurn": 1,
  "steps": [
    {
      "n": 1,
      "action": "open",
      "detail": "read the page",
      "credits": 1,
      "costUsd": 0.001
    }
  ],
  "skipped": [],
  "costUsd": 0.004,
  "createdAt": "2026-11-17T17:50:23.347Z",
  "completedAt": "2026-11-17T17:50:28.183Z",
  "expiresAt": "2026-11-18T17:50:23.347Z"
}
```


## OpenAPI

````yaml api-reference/openapi.json GET /v1/agent/{id}
openapi: 3.1.0
info:
  title: Stophy API
  version: '1'
  description: >-
    Each operation shows its method and its input: a JSON object body, path and
    query parameters, or a file upload.


    Responses leave out empty values: null, empty strings, empty objects and
    empty nested lists are not sent.


    Text comes back whole. To get shorter responses, add
    ?maxTextLength=<characters> to the URL. Every text value longer than that is
    cut and ends with …. A screenshot is never cut, and a page whose text was
    cut has isTruncated set to true.


    The x-cost-usd response header is what the request cost in dollars. An
    operation's description gives its pricing units and add-ons. The OpenAPI
    fields x-cost-usd and x-cost-usd-max are list-price estimates, not receipts
    or spending limits. When a call starts a job, check the job result for its
    total cost.


    When a response has a cursor, send it back unchanged with the same input to
    get the next page. When it has a page, send the next page number.
servers:
  - url: https://api.stophy.dev
security:
  - apiKey: []
paths:
  /v1/agent/{id}:
    get:
      summary: Check an agent run and read its answer
      description: Costs $0 per 1,000 calls.
      operationId: agentStatus
      parameters:
        - $ref: '#/components/parameters/MaxTextLength'
        - name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: The data, and what this call cost in dollars.
          headers:
            X-Request-ID:
              $ref: '#/components/headers/RequestId'
            x-credits-used:
              $ref: '#/components/headers/CreditsUsed'
            x-cost-usd:
              $ref: '#/components/headers/CostUsd'
            X-RateLimit-Limit:
              $ref: '#/components/headers/RateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/RateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/RateLimitReset'
            x-cache:
              $ref: '#/components/headers/Cache'
            x-cache-age:
              $ref: '#/components/headers/CacheAge'
          content:
            application/json:
              schema:
                type: object
                additionalProperties: false
                properties:
                  success:
                    type: boolean
                    const: true
                  status:
                    type: string
                    enum:
                      - processing
                      - completed
                      - failed
                  data:
                    type: object
                    propertyNames:
                      type: string
                    additionalProperties: {}
                  partial:
                    type: object
                    propertyNames:
                      type: string
                    additionalProperties: {}
                  partialSchemaValid:
                    type: boolean
                  stopReason:
                    type: string
                    const: credit_limit_reached
                  error:
                    type: string
                  confidence:
                    type: object
                    propertyNames:
                      type: string
                    additionalProperties: {}
                  sources:
                    type: object
                    propertyNames:
                      type: string
                    additionalProperties: {}
                  message:
                    type: string
                  model:
                    type: string
                  mode:
                    type: string
                    enum:
                      - extract
                      - chat
                  effort:
                    type: string
                    enum:
                      - low
                      - medium
                      - high
                  threadId:
                    type: string
                  threadTurn:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  steps:
                    type: array
                    items:
                      type: object
                      propertyNames:
                        type: string
                      additionalProperties: {}
                  skipped:
                    type: array
                    items:
                      type: object
                      additionalProperties: false
                      properties:
                        id:
                          type: string
                        timestamp:
                          type: string
                        url:
                          type: string
                        error:
                          type: string
                        code:
                          type: string
                        message:
                          type: string
                        retryable:
                          type: boolean
                        at:
                          type: string
                      required:
                        - retryable
                  creditsUsed:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  costUsd:
                    type: number
                required:
                  - success
                  - status
                  - mode
                  - effort
                  - threadTurn
                  - steps
                  - skipped
                  - creditsUsed
                  - costUsd
        4XX:
          $ref: '#/components/responses/Error'
        5XX:
          $ref: '#/components/responses/Error'
components:
  parameters:
    MaxTextLength:
      name: maxTextLength
      in: query
      required: false
      description: >-
        Cut every text value in the response to this many characters. A value
        that was cut ends with …, and a page whose text was cut has isTruncated
        set to true. A screenshot is never cut. Leave it out to get the full
        text.
      schema:
        type: integer
        minimum: 1
  headers:
    RequestId:
      description: The request id. Quote it when you report a problem.
      schema:
        type: string
    CreditsUsed:
      description: >-
        Older header: what this call cost, as whole steps of $0.002. Use
        x-cost-usd.
      schema:
        type: integer
    CostUsd:
      description: What this call cost, in dollars.
      schema:
        type: string
    RateLimitLimit:
      description: Requests allowed in the current window.
      schema:
        type: integer
    RateLimitRemaining:
      description: Requests left in the current window.
      schema:
        type: integer
    RateLimitReset:
      description: Unix time in seconds when the current window resets.
      schema:
        type: integer
    Cache:
      description: hit if this result came from the cache, miss if it was fetched live.
      schema:
        type: string
    CacheAge:
      description: Seconds since the returned result was written to the cache.
      schema:
        type: integer
    RetryAfter:
      description: Seconds to wait before retrying.
      schema:
        type: integer
  responses:
    Error:
      description: The request failed. Retry-After says when trying again can help.
      headers:
        X-Request-ID:
          $ref: '#/components/headers/RequestId'
        Retry-After:
          $ref: '#/components/headers/RetryAfter'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    Error:
      type: object
      required:
        - success
        - error
        - code
      properties:
        success:
          const: false
        error:
          type: string
          description: What went wrong and what to do next.
        code:
          type: string
          enum:
            - apiKeyRequired
            - busy
            - checkRunning
            - cliSessionCompleted
            - cliSessionExists
            - cliSessionNotFound
            - forbidden
            - freeLimit
            - insufficientCredits
            - internalError
            - inviteClaimed
            - inviteDisabled
            - inviteExpired
            - inviteUsedUp
            - invalidCliSession
            - invalidCliVerifier
            - invalidRequest
            - jobFinished
            - methodNotAllowed
            - notFound
            - payloadTooLarge
            - profileBusy
            - profileTooLarge
            - prohibitedPermission
            - promptInjectionDetected
            - rateLimited
            - sourceChanged
            - sourceRefused
            - siteNotRead
            - sourceTimeout
            - sourceUnavailable
            - unauthorized
            - unsupportedMediaType
        retryable:
          type: boolean
          description: true when trying again can help.
        retryAfterSeconds:
          type: integer
        requestId:
          type: string
        requiredCredits:
          type: number
          description: >-
            Older field: the most the call can cost, in $0.002 steps. Sent when
            the balance is too low.
        availableCredits:
          type: number
          description: 'Older field: the balance in $0.002 steps. Sent with requiredCredits.'
        requiredUsd:
          type: number
          description: >-
            The most the call can cost, in dollars. Sent when the balance is too
            low.
        availableUsd:
          type: number
          description: What is left on the account, in dollars. Sent with requiredUsd.
        billingUrl:
          type: string
          description: Where to add money. Sent with requiredUsd.
        signupUrl:
          type: string
          const: https://stophy.dev/signup
          description: >-
            Where a person gets a key. Sent with apiKeyRequired, freeLimit and
            an invalid key.
        signup:
          type: string
          const: POST https://api.stophy.dev/v1/signup
          description: >-
            The call that gets an agent a key with no human. Sent next to
            signupUrl.
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer

````

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