Caravanserais have been used since the 10th century. Trade across Turkey in medieval Seljuk times was dependent on camel trains (kervan, anglicized as caravan), which stopped by night in inns known as kervansaray or caravanserai , literally 'caravan palaces'. These buildings provided accommodation and other amenities for the merchants and stabling for their animals. Caravanseraies were first seen in Central Asia during the times of Caravans, Ghaznavids and the Great Seljuk State. They were building fortresses called "Ribat". These buildings, first constructed as small buildings for military uses were later developed and changed into larger buildings and were used for both religious purposes and as inns for travelers.
Especially during the times of Seljuk Sultans Kilicarslan II and Alaaddin Keykubat I, the construction of these buildings increased after the security of the trading roads was provided by the state. The loss of the trades would be met by the states, which is accepted to be the first insurance system. During that period, both domestic and foreign trades prospered. In this way, the Seljuks, who were already economically powerful, became politically strong, too.
In caravanserais, foreign as well as native traders, would be put up for three days. Their shoes would be repaired or the poor would be given new shoes. The ill would be treated and animals would be tended and, if needed horses would be shoed. For their religious practices, they would use the "Kosk Mescid", a small mosque, in the center of the courtyard. The "Kosk Mescid", usually located in the centre of the courtyard, was the most important part of the caravanserais. These mosques were normally built on an arched base.
The courtyards are normally surrounded with bedrooms, depots, bath house and bathrooms. "Mangals" (braziers) or "tandirs" (oven in the ground) were used to heat the places whereas candles and lamps were used for light. All services were provided by the people working in caravanserais; e.g., doctor, imam (prayer leader), depot officer, veterinarian, messenger, blacksmith, and cook. Stones cut from the volcanic rock were used in the construction of the caravanserais in the region of Cappadocia. For defense purposes, their walls were constructed like castle walls. Some of the best examples of Seljuk stonemasonry can be seen at the entrances, called "Tac Kapi". Although dragon, lion motifs and floral designs most frequently used, in Cappadocia geometrical designs were generally preferred. The doors were made of iron.
Caravanserais were built along roads running from Antalya - Konya - Kayseri to the land of Turkomans passing through Erzurum and Tabriz and from the Black Sea region to Iraq via Amasya - Tokat - Sivas - Malatya - Diyarbakir at a distance of 30-40km, a one day camel trek.
It is possible to see some of the most beautiful examples of caravanserais in the region of Cappadocia, especially between Aksaray and Kayseri, since it is an intersection, east to west and south to north; Sultanhani in Aksaray, Agzikarahan in Aksaray and Sarihan in Avanos. The kervansarays of Cappadocia in central Turkey were built of hewn volcanic stone, and their walls were thick and high so that they would be safe from raids by robbers. Decoration was concentrated on the great portals which display the finest examples of Seljuk stone carving.
The richly carved portal of Aksaray Sultanhani which projects from the walls, and the towers at each corner lend the building a monumental aspect. The portal is made of marble of several colors and leads into the courtyard, in the centre of which is a pavilion mosque. Along the right-hand side of the courtyard is a decoratedcolonnade and to the left storage rooms and chambers. To the north is an area where both animals and people were accommodated.
The next caravanserai (kervansaray) located on this route, 15 km outside Aksaray on the Nevsehir road, is Agzikarahan (Black Mouth), which bears the same name as the village where it is situated. It is alternatively known as Hoca Mesud Kervansaray, after its founder. The first of its two inscriptions tell us that its construction was commenced in 1231 by a wealthy merchant named Hoca Mesud bin Abdullah and completed in 1239. The hall was built during this time by Alaaddin Keykubat I and the courtyard by his son Giyaseddin Keyhusrev II (1237-1246). With its great portals, pavilion mosque, towers and other architectural features, this caravanserai is reminiscent of the castle-like royal hans (Sultanhani). The pavilion mosque is raised upon a four arched sub-structure and stands in the middle of the courtyard, which is surrounded by colonnades and closed rooms.
The carved decoration of Agzikarahan is notable for the absence of the human figures, animals and floral motifs typical of the period. The hamam or bath house is in the rectangular building standing apart to the south.
Agzikarahan is followed by Tepesidelik Han (also known as Oresin Han) 17 km away. This caravanserai has a covered courtyard and since the inscription is missing, it is not known exactly when it was built or by whom. Researchers agree however, that it probably dates from the third quarter of the 13th century. The portal and part of the dome are in ruins, but the spaces roofed by cradle vaults and supported by symmetrically placed groups of three columns around the pendentive dome are striking in appearance.
A further 12 km on is Alayhan, one of the first caravanserais built by sultans, but now divided in two by the present Aksaray-Nevsehir road. This building may be what in written sources is referred to as the Kilicarslan II Kervansaray. Royal caravanserais generally consisted of one open and one covered section. Unfortunately the open section of this kervansaray has been completely destroyed, leaving only part of the covered section consisting of three bays roofed by seven vaults. The portal is decorated with geometric motifs and seven rows of mukarnas (stalactite) carving, and features a carved lion with a single head and double body.
We next come to Sarihan Caravanserai in the province of Nevsehir on the road between to Kayseri. Sarihan (also spelled as Saruhan, meaning Yellow Caravanserai) covers an area of 2000 square meters and was built during the reign of Izzettin Keykavus II (1249-1254), perhaps by him, in 1249. It is constructed of smoothly hewn yellow, pink and beige stone. Two contrasting colors of stone are used to decorative effect on the arches of the main outer portal and inner portal. Restoration of this caravanserai, parts of which were in ruins, was completed in 1991. This was the last caravanserai to be built by the Seljuk sultans. Today, the whirling dervishes ceremonie is performed nightly at the Sarihan Caravanserai.
Another important caravanserai is Kayseri Sultanhani in the village of Tuzhisar 45 km from Kayseri on the Sivas Road. The inscription on its hall portal tells us that it was built between 1232 and 1236 by Alaaddin Keykubat I. This caravanserai covers an area of 3900 square meters and its plan is similar to that of Aksaray Sultanhani. The portal in the north wall is flanked by semicircular towers with square bases. Although this partially ruined portal is typical of classical Seljuk portals, the towers enhance its grandeur. A hall with high arches leads into the square courtyard, in the centre of which is a pavilion mosque raised on arches. On the northwest side of the courtyard is a domed hamam in five sections which is entered via a door at the northwest corner of the arcade to the right. This caravanserai was restored in 1951.
The last caravanserai in Cappadocia area is Karatayhan built by Celaleddin Karatay on the old Kayseri-Malatya road, part of the main trade route into Syria. Construction commenced during the reign of Alaaddin Keykubat and was completed during that of his son Giyaseddin Keyhusrev in 1240/1241. The inscription opens with the words, 'This building belongs to God, who is One, Eternal, and Everlasting'. Celaleddin Karatay came from Kayseri to see the finished building, and was so overwhelmed by its magnificence that he sped away again, afraid that he would be carried away by pride in his own accomplishment. The endowment deed of Karatayhan tells us that it was built to serve both commercial and social functions. The ornately carved portal which dominates the south wall measures 46 by 80 meters, and projects both beyond and above the wall. The decoration includes floriate and figurative as well as geometric motifs, which distinguishes it from other caravanserais. An eyvan (open-fronted vaulted hall) with pointed vault leads from the portal into the courtyard. Along the eastern side of the courtyard is a series of long narrow chambers with pointed vaults opening directly onto the courtyard, while an arcade runs down the western side. Like the towns and villages through which the trade roads passed, the vicinity of the caravanserai once turned into small commercial centers. This was true of Karatayhan, which in the 13th century stood at a junction of roads.
When Europeans found new ways to China, the Silk Road started to lose importance and of course the caravanserais as well. After the 15th and 16th centuries, most of the caravanserais were never used again.