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

# Quickstart

> Start increasing the observability of your video generation workflow with Mocra.

## Getting started

### Step 1: Choose and set up your environment

<AccordionGroup>
  <Accordion icon="terminal" title="HTTP API">
    Mocra has a powerful RESTful HTTP API accessible at `https://api.mocra.io/`.
    You can use it to interact with Mocra if you prefer an HTTP interface or if
    your favorite programming language is not listed below.

    Using the HTTP API does not require installing anything as long as your
    language or environment can perform HTTP operations.
  </Accordion>

  <Accordion icon="js" title="JavaScript SDK">
    If you prefer an SDK, we provide a driver for JavaScript and TypeScript. To use the
    JavaScript SDK, install it with npm:

    ```bash theme={null}
    npm install @mocra/observe
    ```

    TypeScript typings are included.
  </Accordion>

  <Accordion icon="python" title="Python SDK">
    If you prefer an SDK, we provide a driver for Python. To use the Python SDK,
    install it with pip:

    ```bash theme={null}
    pip install mocra
    ```

    The SDK requires Python 3.10 or higher.
  </Accordion>
</AccordionGroup>

### Step 2: Get a Mocra API key

An API key is required to interact with Mocra.

Currently, Mocra is in beta trial, so a limited number of API keys are being issued to selected customers.
If you are interested in using Mocra, email `contact@mocra.io` to join our waitlist.

### Step 3: Write your code

<AccordionGroup>
  <Accordion icon="terminal" title="HTTP API">
    You can use the HTTP API from any environment that supports HTTP requests. Here is an example using cURL:

    ```bash theme={null}
    curl \
      -X POST \
      -H "Authorization: Bearer <YOUR API KEY>" \
      -H "Content-Type: application/json" \
      -H "Accept: application/json" \
      -d "{\
          \"videoUrl\": \"<YOUR VIDEO URL>\",\
          \"customCriteria\": [],\
          \"removeCriteria\": []\
      }"\
      https://api.mocra.io/observe
    ```
  </Accordion>

  <Accordion icon="js" title="JavaScript SDK">
    Import the required class from `@mocra/observe` and use it as in the example that follows:

    ```typescript theme={null}
    import { VideoObservabilityApi } from "@mocra/observe";

    const api = new VideoObservabilityApi("<YOUR API KEY>");
    const result = await api.scoreVideo(
      "http://example.org/video.mp4",
      [
        {
          criterionName: "Blur",
          criterionDescription: "The video should not be blurry",
        },
      ],
      ["UNNATURAL PHYSICS"],
    );
    console.log(result.severity, result.criteria);
    ```
  </Accordion>

  <Accordion icon="python" title="Python SDK">
    Import the required classes from `mocra` and use them as in the example that follows:

    ```python theme={null}
    from mocra import VideoObservabilityApi, ExtraCriterion

    api = VideoObservabilityApi("<YOUR API KEY>")
    result = api.score_video(
        "http://example.org/video.mp4",
        extra_criteria=[
            ExtraCriterion(
                criterion_name="Blur",
                criterion_description="The video should not be blurry",
            ),
        ],
        ignore_criteria=["UNNATURAL PHYSICS"],
    )
    print(result.severity, result.criteria)
    ```
  </Accordion>
</AccordionGroup>

## Next steps

Now that you're set up, explore these key features:

<CardGroup cols={2}>
  <Card title="JavaScript SDK" icon="js" href="/sdks/javascript">
    Reference documentation for the Mocra JavaScript SDK.
  </Card>

  <Card title="Python SDK" icon="python" href="/sdks/python">
    Reference documentation for the Mocra Python SDK.
  </Card>
</CardGroup>
