# Download existing OpenApiContract

Existing artifact owned by scripts/generate-openapi.ts. This operation retrieves its bytes; use the native protocol's current consumer setup to interpret the contract.

Operation: downloadOpenApiContract
GET /api/openapi.json

Access: anonymous. Automatic retries: none. Redirects: manual. Request body limit: 0 bytes.
Default timeout: 30 seconds. Response limit: 16 MiB. Pagination is opt-in and bounded; an exhausted bound reports incomplete execution.

[HTML reference](/developers/api/downloadOpenApiContract) · [Authoritative schemas](/api/openapi.json)

## Wire contract

```json
{
  "operationId": "downloadOpenApiContract",
  "summary": "Download existing OpenApiContract",
  "tags": [
    "discovery"
  ],
  "description": "Existing artifact owned by scripts/generate-openapi.ts. This operation retrieves its bytes; use the native protocol's current consumer setup to interpret the contract.",
  "x-artifact-download": true,
  "responses": {
    "200": {
      "description": "Existing generated contract artifact",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "additionalProperties": true
          }
        }
      }
    },
    "304": {
      "description": "Not modified; no response body"
    }
  }
}
```

## Synthetic examples

### curl

```bash
curl --fail-with-body --max-time 30 --max-filesize 16777216 --request GET 'https://irvinebroque.com/api/openapi.json' --header 'Accept: application/json'
```

### TypeScript

```typescript
import { PublicApi } from '@irvinebroque/public-api';
const api = new PublicApi();
const result = await api.discovery.openapi({});
console.log(result.status, result.headers.get('content-type')); // Keep transient capabilities in memory.
```

### CLI

```bash
irvinebroque discovery openapi
```
