{"id":16992006,"url":"https://github.com/kyletryon/timephone-api","last_synced_at":"2025-10-09T21:36:58.156Z","repository":{"id":241531490,"uuid":"609302563","full_name":"KyleTryon/TimePhone-API","owner":"KyleTryon","description":"A Restful API service for the TimePhone! powered by ChatGPT, Whisper, and GCP TextToSpeech","archived":false,"fork":false,"pushed_at":"2023-03-30T02:17:29.000Z","size":746,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-02T07:00:35.040Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KyleTryon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-03T20:15:46.000Z","updated_at":"2024-02-26T18:06:20.000Z","dependencies_parsed_at":"2024-05-29T00:07:47.317Z","dependency_job_id":null,"html_url":"https://github.com/KyleTryon/TimePhone-API","commit_stats":null,"previous_names":["kyletryon/timephone-api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/KyleTryon/TimePhone-API","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KyleTryon%2FTimePhone-API","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KyleTryon%2FTimePhone-API/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KyleTryon%2FTimePhone-API/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KyleTryon%2FTimePhone-API/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KyleTryon","download_url":"https://codeload.github.com/KyleTryon/TimePhone-API/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KyleTryon%2FTimePhone-API/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279002055,"owners_count":26083286,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-14T03:28:03.310Z","updated_at":"2025-10-09T21:36:58.139Z","avatar_url":"https://github.com/KyleTryon.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TimePhone-API\n\nThe TimePhone-API powers the magical payphone with the power to contact anyone, past or present, live or dead, real or fictional! Ask the operator to speak to anyone and TimePhone will make it happen!\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your local machine for development and testing purposes.\n\n1. `npm install`\n1. `npm run migrate`\n1. `docker compose up -d` to start the database and minio.\n1. Configure mini as shown in the [Storage](docs/Storage.md) documentation.\n1. Configure your `.env` file, example below. See the [Secrets](docs/Secrets.md) documentation for more information.\n1. `npm run start`\n1. Navigate to `http://localhost:3000/api` for Swagger documentation.\n\n### example .env file\n\n```sh\nDATABASE_URL=\"postgresql://user:password@localhost:5433/time-phone?schema=public\"\nOPENAI_API_KEY=\"\"\nGCP_AUTHJSON_BASE64=\"\"\nAWS_ACCESS_KEY_ID=\"\"\nAWS_SECRET_ACCESS_KEY=\"\"\nAWS_S3_ENDPOINT=\"http://minio:9000\"\nAWS_S3_BUCKET=\"\"\nAWS_S3_REGION=\"\"\n```\n\n## Usage\n\n### Create a new conversation\n\nStart a new conversation by passing the `/calls` endpoint a `POST` request with a JSON body containing the `character` and `prompt` keys.\nThe character information will be used to select a suitable voice for the call.\nThe prompt will \"program\" the conversation and will be used to generate the first response.\n\n```sh\ncurl --request POST \\\n  --url http://timephone:3000/calls \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"character\": \"Max Planck\",\n \"prompt\": \"You must pretend to be Max Planck, you know their life history and will speak in their style. Begin the conversation as you would answer a phone in live conversation as your new persona.\"\n}'\n```\n\nYou will get back a response containing the call `id` which can be used for posting new messages to the conversation.\nYou will also get back a `prompt` which is the first response from the AI.\n\n```json\n{\n \"id\": 10,\n \"character\": \"Max Planck\",\n \"createdAt\": \"2023-03-28T00:42:29.947Z\",\n \"prompt\": \"You must pretend to be Max Planck, you know their life history and will speak in their style. Begin the conversation as you would answer a phone in live conversation as your new persona.\",\n \"response\": {\n  \"text\": \"\\\"Good day, this is Max Planck speaking. How may I assist you?\\\"\"\n }\n}\n```\n\n### Continue a conversation\n\nSend messages to an existing conversation by sending your `audio` and `callId` to the `/messages` endpoint.\n\n```sh\ncurl --request POST \\\n  --url http://timephone:3000/messages \\\n  --header 'Content-Type: multipart/form-data' \\\n  --form callId=96 \\\n  --form 'audio=@when_were_you_born.mp3'\n```\n\nYou will receive a response containing the `prompt` which is the AI's response to your message.\n\n```json\n{\n \"callId\": 10,\n \"request\": {\n  \"text\": \"And what year were you born?\"\n },\n \"response\": {\n  \"text\": \"I was born on April 23, 1858.\",\n  \"audio\": \"http://timephone:9000/timephone/1679964871156-i-was-born-on-april-23--1858-.mp3\"\n }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkyletryon%2Ftimephone-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkyletryon%2Ftimephone-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkyletryon%2Ftimephone-api/lists"}