1. Chat
Pet Store
  • Store API
    • Start your Apidog journey
    • Pet
      • List Pets
      • Create Pet
      • Get Pet
      • Update Pet
      • Delete Pet
      • Upload Pet Image
    • Chat
      • Pet Care AI Consultation
        POST
    • Store
      • Get Store Inventory
      • List all inventories
      • Create Order
      • Get Order
      • Cancel Order
      • Callback Example
    • Payments
      • Pay Order
    • User
      • Create User
      • Update User
      • Get User
      • Delete User Account
      • Create Authentication Token
    • Webhooks
      • Order Status Changed Event
      • Payment Succeeded Event
    • Websocket, Socket.IO & more
      • gRPC API
      • Other protocol API example
      • WebSocket example
      • Socket.IO example
      • Webhook example
      • GraphQL example
      • SSE example
      • SOAP example
    • Schemas
      • Pet
      • User
      • PetCollection
      • OrderPayment
      • Bank Card
      • Order
      • Bank Account
      • ApiResponse
      • Error
  • Admin API
    • Dashboard
      • Get Dashboard Stats
    • User Management
      • List Users
      • Get User Details
      • Update User Status
    • Order Management
      • List All Orders
      • Force Cancel Order
    • Audit Logs
      • Get Audit Log Details
    • Schemas
      • AuditLog
  1. Chat

Pet Care AI Consultation

POST
/chat/completions
AI-powered consultation service for pet care questions and advice. This endpoint provides expert guidance on pet health, behavior, nutrition, training, and general care through an intelligent conversational interface. Supports streaming responses using Server-Sent Events (SSE) for real-time interaction.

OpenAI API Compatibility#

This endpoint follows the OpenAI Chat Completions API specification, which has become the de facto industry standard for chat-based AI interactions. By maintaining compatibility with OpenAI's API design, this endpoint ensures:
Seamless integration with existing OpenAI-compatible SDKs and tools
Familiar developer experience for those already using OpenAI APIs
Easy migration path for applications built on OpenAI's platform
Note: Some field names (e.g., created instead of createdAt) intentionally differ from this API's naming conventions to maintain full OpenAI compatibility.

Pet Care Expert AI#

Our AI consultation service helps pet owners with:
Health & Wellness: Symptom assessment, vaccination schedules, preventive care advice
Nutrition: Diet recommendations, feeding schedules, food allergies and sensitivities
Behavior & Training: Behavioral issues, training techniques, socialization tips
Breed Information: Breed-specific care requirements, temperament, compatibility
Adoption Guidance: Choosing the right pet, preparation for new pets, adoption process
Emergency Guidance: First aid advice, when to see a vet, urgent care situations
Disclaimer: This AI provides general guidance only and does not replace professional veterinary care. Always consult a licensed veterinarian for medical diagnosis and treatment.

Streaming Mode#

When stream: true, the response is sent as Server-Sent Events (SSE), with each token delivered incrementally. This provides a better user experience for longer responses.

Stream Format#

Each chunk is sent as:
data: {"id":"chatcmpl_abc","object":"chat.completion.chunk","choices":[{"delta":{"content":"Hello"},"index":0}]}
The stream ends with:
data: [DONE]

Non-Streaming Mode#

When stream: false or omitted, returns a complete response object.

Request

Authorization
JWT Bearer
Add the parameter
Authorization
to Headers
Example:
Authorization: ********************
or
OAuth 2.0
Authorization Code
Add the parameter
Authorization
to Headers
,whose value is to concatenate the Token after the Bearer.
Example:
Authorization: Bearer ********************
Authorize URL: https://auth.petstoreapi.com/authorize
Token URL: https://auth.petstoreapi.com/token
Refresh URL: https://auth.petstoreapi.com/refresh
Scopes:
chat:write-Access AI chat completions
or
Body Params application/jsonRequired

Examples

Responses

🟢201
application/json
Successful response. Format depends on the stream parameter.
Headers

Bodyapplication/json

🟠400BadRequest
🟠401Unauthorized
🟠422UnprocessableEntity
🟠429TooManyRequests
Request Request Example
Shell
JavaScript
Java
Swift
cURL (Non-Streaming)
curl -X POST 'https://api.petstoreapi.com/v1/chat/completions' \
  -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "messages": [
      {
        "role": "user",
        "content": "What should I know before adopting a cat?"
      }
    ],
    "model": "pet-advisor-1",
    "stream": false
  }'
Response Response Example
201 - Complete chat response
{
    "id": "chatcmpl_abc123",
    "object": "chat.completion",
    "created": 1702648800,
    "model": "pet-advisor-1",
    "choices": [
        {
            "index": 0,
            "message": {
                "role": "assistant",
                "content": "Before adopting a cat, consider these important factors:\n\n1. **Time Commitment**: Cats can live 15-20 years\n2. **Space**: Ensure you have adequate living space\n3. **Allergies**: Check if anyone in your household has cat allergies\n4. **Costs**: Budget for food, litter, vet care, and supplies\n5. **Lifestyle**: Consider if your schedule allows for proper care\n\nWould you like recommendations for cats currently available for adoption?"
            },
            "finishReason": "stop"
        }
    ],
    "usage": {
        "promptTokens": 15,
        "completionTokens": 89,
        "totalTokens": 104
    }
}
Modified at 2026-05-13 03:16:01
Previous
Upload Pet Image
Next
Get Store Inventory
Built with