# OpenAI vs Anthropic shape

Source: https://staging-docs.aiand.com/api/file-shapes/

The ai& Files API is a single endpoint that responds in two shapes — selected by whether your request carries an `anthropic-version` header.

This means both the official `openai` SDK and the `anthropic` SDK work against the same URL, with the same API key, without any code changes.

## Header-based shape selection

| Header | Response shape |
|--------|----------------|
| `anthropic-version: <any>` | Anthropic Files API shape |
| (header absent) | OpenAI Files API shape |

## Example: same file, two shapes

<Tabs>
<TabItem label="OpenAI shape">

```bash
curl https://api.aiand.com/v1/files/file-abc123 \
  -H "Authorization: Bearer sk-..."
```

```json
{
  "id": "file-abc123",
  "object": "file",
  "bytes": 12345,
  "created_at": 1716960000,
  "filename": "cat.png",
  "purpose": "vision"
}
```

</TabItem>
<TabItem label="Anthropic shape">

```bash
curl https://api.aiand.com/v1/files/file-abc123 \
  -H "Authorization: Bearer sk-..." \
  -H "anthropic-version: 2023-06-01"
```

```json
{
  "id": "file-abc123",
  "type": "file",
  "size_bytes": 12345,
  "created_at": "2026-05-18T12:00:00Z",
  "filename": "cat.png",
  "mime_type": "image/png"
}
```

</TabItem>
</Tabs>

## What this enables

- The OpenAI Python SDK's `client.files.create(...)` works as-is.
- The Anthropic Python SDK's `client.beta.files.upload(...)` works as-is.
- You can upload via one SDK and read back via the other — same `file_id` either way.

<Aside type="tip">
  The Anthropic SDK doesn't have a `purpose` field. ai& infers it from MIME type — see [Purposes](/api/file-purposes/).
</Aside>
