Text to Image
Get Session

Get Session Detail

Retrieve session details for a specific text-to-image session.

Request

GET https://api.csm.ai/tti-sessions/<Session Code>

Code Snippets

Python

import requests
 
url = "https://api.csm.ai/tti-sessions/SESSION_1689257215_1674078"
 
payload = {}
headers = {
  'x-api-key': '<X-API_KEY>',
  'Content-Type': 'application/json'
}
 
response = requests.request("GET", url, headers=headers, data=payload)
 
print(response.text)

Node.js

var request = require('request');
var options = {
  method: 'GET',
  url: 'https://api.csm.ai/tti-sessions/SESSION_1689257215_1674078',
  headers: {
    'x-api-key': '<X-API_KEY>',
    'Content-Type': 'application/json'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});

Curl

curl -k --location 'https://api.csm.ai/tti-sessions/SESSION_1708511217_2415791' \
--header 'x-api-key: <X-API_KEY>'

Response

{
    "error": "",
    "message": "Retrieved",
    "statusCode": 200,
    "data": {
        "_id": "65d5cff166a366841c61e6b2",
        "session_code": "SESSION_1708511217_2415791",
        "style_id": "",
        "prompt": "3d asset of a character head, cartoon style, low poly, front view",
        "guidance": 6,
        "user_id": "652d54ef642585b4048a3ecf",
        "image_url": "https://image-url.com",
        "type": "manual",
        "status": "completed",
        "is_deleted": false,
        "created_at": "2024-02-21T10:26:57.956Z",
        "updated_at": "2024-02-21T10:27:10.600Z"
    }
}