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

# API clients

> Call OrgX REST API v1 from JavaScript or Python with the same create-and-complete workflow.

OrgX uses ordinary HTTPS and JSON. Start with your runtime’s standard HTTP
client; generate a typed client from the [OpenAPI
document](https://useorgx.com/api/v1/openapi.yaml) when your application needs
broader coverage.

<Tabs>
  <Tab title="JavaScript">
    ```js theme={"dark"}
    const response = await fetch('https://useorgx.com/api/v1/work', {
      method: 'POST',
      headers: {
        Authorization: `Bearer ${process.env.ORGX_API_KEY}`,
        'Content-Type': 'application/json',
        'Idempotency-Key': 'launch-plan-review-001',
      },
      body: JSON.stringify({ title: 'Review the launch plan' }),
    });
    const created = await response.json();
    console.log(created.data.taskId, created.data.receiptId);
    ```
  </Tab>

  <Tab title="Python">
    ```python theme={"dark"}
    import json
    import os
    from urllib.request import Request, urlopen

    request = Request(
        "https://useorgx.com/api/v1/work",
        data=json.dumps({"title": "Review the launch plan"}).encode(),
        headers={
            "Authorization": f"Bearer {os.environ['ORGX_API_KEY']}",
            "Content-Type": "application/json",
            "Idempotency-Key": "launch-plan-review-001",
        },
        method="POST",
    )
    created = json.load(urlopen(request))
    print(created["data"]["taskId"], created["data"]["receiptId"])
    ```
  </Tab>
</Tabs>

## Complete work

Use the task ID in the URL and send the concurrency values returned by create:

```text theme={"dark"}
POST /api/v1/work/{taskId}/complete
```

```json theme={"dark"}
{
  "expected_updated_at": "2026-08-18T18:30:00.000Z",
  "expected_aggregate_version": 1,
  "summary": "Launch plan reviewed",
  "evidence": { "reviewed_sections": 12, "broken_links": 0 }
}
```

## Where the result appears

Open `https://useorgx.com/tasks/{taskId}` with the ID returned by create. The
same ID remains stable across idempotent retries.

## Generate a client

The OpenAPI document includes operation-scoped request and response examples.
Use a generator that supports OpenAPI 3.1 and pin the generated code in your
normal dependency workflow.
