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

# image-to-text

> Generate textual descriptions from images for tasks like image captioning, content generation, and accessibility features

<AccordionGroup>
  <Accordion defaultOpen="true" title="Basic usage">
    For example, ask a model to describe an image

    <CodeGroup>
      ```javascript javascript theme={null}
      import Bytez from 'bytez.js';

      // insert your key
      const sdk = new Bytez('BYTEZ_KEY');

      // choose your model
      const model = sdk.model('Salesforce/blip-image-captioning-base');

      // provide the model with input
      const input = {
        "url": "https://as1.ftcdn.net/v2/jpg/03/03/55/82/1000_F_303558268_YNUQp9NNMTE0X4zrj314mbWcDHd1pZPD.jpg"
      };

      // send to the model
      const { error, output } = await model.run(input);

      // observe the output
      console.log({ error, output });

      ```

      ```python python theme={null}
      from bytez import Bytez

      # insert your key
      sdk = Bytez("BYTEZ_KEY")

      # choose your model
      model = sdk.model("Salesforce/blip-image-captioning-base")

      # provide the model with input
      input = {
        "url": "https://as1.ftcdn.net/v2/jpg/03/03/55/82/1000_F_303558268_YNUQp9NNMTE0X4zrj314mbWcDHd1pZPD.jpg"
      }

      # send to the model
      result = model.run(input)

      # observe the output
      print({"error": result.error, "output": result.output})

      ```

      ```bash http theme={null}
      curl -X POST 'https://api.bytez.com/models/v2/Salesforce/blip-image-captioning-base' \
      -H 'Authorization: BYTEZ_KEY' \
      -H 'Content-Type: application/json' \
      --data '{
        "url": "https://as1.ftcdn.net/v2/jpg/03/03/55/82/1000_F_303558268_YNUQp9NNMTE0X4zrj314mbWcDHd1pZPD.jpg"
      }'
      ```

      You can send the **image** via `url` or `base64` data URL.

      We recommend `url` for better performance, as `base64` increases payload size.
    </CodeGroup>
  </Accordion>
</AccordionGroup>
