Forums

Connecting to database with GPT though API (endpoint issue)

Hello! I need help to figure out how to connect to my MySQL database hosted here from my GPT. I just need my GPT to post some data inside a table in my database. But when trying to connect it is giving me 404 error. I believe I have some mistake in my endpoint and/or path. This is the start of my schema:

info:
 title: PythonAnywhere MySQL Database API
  description: API for posting data to a MySQL database (<user>$<database>) hosted on PythonAnywhere.
    Database is accessed via a custom API at the host address <user>.mysql.pythonanywhere-services.com.
  version: 1.0.0
servers:
  - url: https://www.pythonanywhere.com/
    description: PythonAnywhere server hosting the custom API
paths:
  /<table>:
    post:
      operationId: postTo<table>

Apologies if it's a stupid question, I'm quite new to this and trying to learn how all of this works. Thank you!

Take a look at https://help.pythonanywhere.com/pages/AccessingMySQLFromOutsidePythonAnywhere/