Skip to content

Picture description API #174

Closed
Closed
@dalton5

Description

@dalton5

Hi,

I try to use picture description api but t's not working.

I tried a lot of different things to call the api in javascript with picture_description_api. Nothing works. Can you confirm it works well or show an example?

If I use the parameter like the usage help document is showing no parameters are taken in account.

const parameters = {
    to_formats: ['json'],
    table_mode: 'fast',
    do_ocr: true,
    return_as_file: false,
    picture_description_api: {
      url: "https://openrouter.ai/api/v1",
      headers: {
        Authorization: "Bearer sk-or-v1-xxxx",
        "Content-Type": "application/json"
      },
      params: {
        model: "google/gemma-3-4b-it"
      },
      timeout: 20,
      prompt: "describe the image with data details, numbers and values"
    }
  };
   formData.append('parameters', JSON.stringify(parameters));

And with a call with


formData.append("from_formats", "pdf");
formData.append("to_formats", "json");
formData.append("table_mode", "fast");
formData.append("do_ocr", "true");
formData.append("return_as_file", "false");


formData.append("picture_description_api", JSON.stringify({
  url: "https://openrouter.ai/api/v1",
  headers: {
    Authorization: "Bearer sk-or-v1-xxxx",
    "Content-Type": "application/json"
  },
  params: {
    model: "google/gemma-3-4b-it"
  },
  timeout: 20,
  prompt: "describe the image with data details, numbers and values"
}));

It gives an error: 422 unprocessable entity

What is the good syntax?

If I do not use picture_description_api it works well.

Thanks,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions