PhotoGPT Developers

Verify that API authentication and connectivity are working.

Health Check

Use GET /ping to verify that your API key, API version header, and network path are working before you run model or generation requests.

Request

const response = await fetch(`${BASE_URL}/ping`, {
  headers,
})

if (!response.ok) {
  throw new Error(await response.text())
}

console.log(await response.json())
response = requests.get(f"{BASE_URL}/ping", headers=headers)
response.raise_for_status()

print(response.json())

Expected response:

{
  "message": "pong!",
  "status": "OK"
}

Troubleshooting

SymptomCheck
401 UnauthorizedConfirm Authorization: Bearer <YOUR_API_KEY> is present and valid.
400 or 404Confirm the base URL is https://developer.photogptai.com/api.
Version errorsConfirm API-Version: 1 is included.
Network failureCheck outbound HTTPS access from your environment.

API reference

On this page