Hello everyone, I’m from EU, Italy, and I have problem with my APY_KEY. As for serping, and opena...
Hello everyone, I’m from EU, Italy, and I have problem with my APY_KEY. As for serping, and openai I have saved in the env file the key copied from the url: https://va.eu-west-1.landing.ai/my/settings/api-key. I still have 1.000 credits, that landing AI gives for free (thanks a lot).
I’m trying to extract data from an image with an excel inside. The parse starts giving the right info, reading the right api_key as reported below , but than stopped with note the: API_KEY is invalid. really I don’t understand why. Below my code and the image attached:
import os
from dotenv import load_dotenv
load_dotenv()
VISION_AGENT_API_KEY =os.getenv('VISION_AGENT_API_KEY')
print(VISION_AGENT_API_KEY ) # APY_KEY READ
from agentic_doc.parse import parse
# Parse a local file
result = parse("immagine1.png")
print(result[0].markdown) # Get the extracted data as markdown
print(result[0].chunks) # Get the extracted data as structured chunks of content
Below the answer:
2025-10-07 14:51:14 [info ] Settings loaded: {
"endpoint_host": "https://api.va.landing.ai",
"vision_agent_api_key": "ZmZvb[REDACTED]", 🤥 Apy key starts with the right letters
"batch_size": 4,
"max_workers": 5,
"max_retries": 3,
"max_retry_wait_time": 60,
"retry_logging_style": "log_msg",
"pdf_to_image_dpi": 96,
"split_size": 10,
"extraction_split_size": 50
} [agentic_doc.config] (config.py:172)Error:
ValueError Traceback (most recent call last)
Cell In[5], line 4
1 from agentic_doc.parse import parse
3 # Parse a local file
----> 4 result = parse("immagine1.png")
5 print(result[0].markdown) # Get the extracted data as markdown
6 print(result[0].chunks)
File ~\anaconda3\Lib\site-packages\agentic_doc\parse.py:103, in parse(documents, include_marginalia, include_metadata_in_markdown, result_save_dir, grounding_save_dir, connector_path, connector_pattern, extraction_model, extraction_schema, config)
100 if config and config.extraction_schema:
101 extraction_schema = config.extraction_schema
--> 103 check_endpoint_and_api_key(
104 _get_endpoint_url(settings),
105 api_key=(
106 config.api_key
107 if config and config.api_key
108 else settings.vision_agent_api_key
109 ),
110 )
112 # Convert input to list of document paths
113 doc_paths = _get_document_paths(documents, connector_path, connector_pattern)
File ~\anaconda3\Lib\site-packages\agentic_doc\utils.py:40, in check_endpoint_and_api_key(endpoint_url, api_key)
38 raise ValueError("API key is not valid for this endpoint.")
39 elif response.status_code == 401:
---> 40 raise ValueError("API key is invalid")
42 _LOGGER.info("API key is valid.")
ValueError: API key is invalid
I don’t understand why the APY_Key is invalid. Someone could help?
Thank you.