Why there is Differences between Restful API and prompt page in generating articles

I am using prompt page. It create a greate result.

{“article_title”: “topic Name”,
“meta_description”: “description”,
“keywords”: “keywords”,
“article_content”: “content”}

when I try to do the same request using Restful API, all I got is
{“text”:“content”}

Why the difference: -

In AI Studio’s UI adds a hidden system prompt and context wrappers to structure the responses like the formatting content as JSON with title, description and keywords.
In the REST API for example the generateContent endpoint only processes what you explicitly include in the prompt.

So unless we instruct the model to return structured fields, the default will be used.
Now, how to replicate it?

Json
{
"contents": [
{
"role":"user",
"parts": [
{
"text": "Type your prompts and ask for a JSON structured format"
}
]
}
]
}

Refer: Text generation | Gemini API | Google AI for Developers
or the cookbook from GitHub for more clarity.