NotionAI used to work, but now I get a 400 error from the same code

  Kiến thức lập trình

I ran the following code, but an error occurred. When I ran it a few months ago, it worked fine without any errors. Do you know how to solve it?

from notionai import NotionAI
from config import *

topic = "test"

res = ai.blog_post(f'write a blog about {topic}')

data: {"errorId":"7a0f6b56-c899-4246-b572-fee21d1bb960","name":"ValidationError","debugMessage":"Invalid input.","message":"Something went wrong. (400)"}, error: 'type'

I thought it was an API key issue, so I went into Notion, pressed F12, found the space id in token_v2 and localstorage, and updated it again.

New contributor

Jinhyuk An is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.